Calender

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  
<< October 2019 >>

Categories

Archives

Recent Entries

中学生のためのExcel VBA

4-6 請求書(4)奇数命令文挿入

JUGEMテーマ:Office VBA

 

Range("B2:C3").Merge
    Range("A1").Offset(3, 3).Value = "D4 だよ"

Cells(g + 2, "p").Value = _
       CStr(Cells(g, "f").Value) + "-" + CStr(Cells(g, "g").Value) + _
       Cells(g, "r").Value + Cells(g + 2, "p").Value


Dim gu As Integer
' 行削除
Range("21:100").Delete
Range("c22").Select
g = 4
gu = 21
r = 2
 Do Until Worksheets("moto").Cells(g, "i").Value = ""
           With ActiveCell
            If Worksheets("moto").Cells(g, "f").Value = _
            Cells(2, "d") And _
            Worksheets("moto").Cells(g, "g").Value = _
            Cells(2, "f") Then
' 表のコピー

    Range(Cells(4, r), Cells(18, r+8)).Copy
    Cells(gu, r).PasteSpecial
    Application.CutCopyMode = False
            .Value = Worksheets("kaikei").Cells(g, "i").Value + _
                  Worksheets("kaikei").Cells(g, "g").Value
            .Offset(1, 0).Value = CStr(Worksheets("kaikei").Cells(g, "c").Value) + "-"+ _
                            CStr(Worksheets("kaikei").Cells(g, "d").Value) + _
                            CStr(Worksheets("kaikei").Cells(g, "j").Value)
            .Offset(6, 0).Value = Worksheets("kaikei").Cells(g, "k").Value
            .Offset(7, 0).Value = Worksheets("kaikei").Cells(g, "l").Value
            .Offset(8, 0).Value = Worksheets("kaikei").Cells(g, "m").Value
            .Offset(9, 0).Value = Worksheets("kaikei").Cells(g, "n").Value
            .Offset(17, 0).Select
            gu = gu+ 17
            End If
            g = g + 2
           End With
        Loop
Range("g4").Select

  • 2019.06.13 Thursday
  • 00:00

Comment
Send Comment