Calender

S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28293031   
<< July 2019 >>

Categories

Archives

Recent Entries

中学生のためのExcel VBA

3-15 会計金額挿入(10)長子用命令文

JUGEMテーマ:Office VBA

 

Call 電話ソート
    Call hani
    g= 4
    Range(Cells(g, "z"), Cells(gyou, "ad")).Value = ""
    '兄弟記録1
    For g = 4 To gyou
        If Cells(g, "y").Value = 1 Then
        Cells(g, "z").Value = Cells(g, "ae").Value
        Cells(g, "aa").Value = Cells(g, "af").Value
        Cells(g, "ab").Value = Cells(g, "ag").Value
        Cells(g, "ac").Value = Cells(g, "ah").Value
        End If
    Next g
    '兄弟記録2
    For g = 4 To gyou
        If Cells(g, "o").Value = Cells(g + 1, "o").Value Then
        Cells(g + 1, "z").Value = Cells(g, "ae").Value + Cells(g + 1, "ae").Value
        Cells(g , "z").Value = ""
        Cells(g + 1, "ab").Value = Cells(g, "ag").Value + Cells(g + 1, "ag").Value
        Cells(g , "ab").Value = ""
        Cells(g + 1, "ac").Value = Cells(g, "ah").Value + Cells(g + 1, "ah").Value
        Cells(g , "ac").Value = ""
    End If
    Next g
   '兄弟3
   For g = 4 To gyou
      If Cells(g, "o").Value = Cells(g + 2, "o").Value Then
       Cells(g +2, "z").Value = Cells(g , "ae").Value + _
       Cells(g + 1, "ae").Value + Cells(g + 2, "ae").Value
       Cells(g + 1, "z").Value = ""
       Cells(g +2, "ab").Value = Cells(g , "ag").Value + _
       Cells(g + 1, "ag").Value + Cells(g + 2, "ag").Value
       Cells(g + 1, "ab").Value = ""
       Cells(g +2, "ac").Value = Cells(g , "ah").Value + _
       Cells(g + 1, "ah").Value + Cells(g + 2, "ah").Value
       Cells(g + 1, "ac").Value = ""
    End If
    Next g
Call 年組名前ソート

  • 2019.07.04 Thursday
  • 20:59

Comment
Send Comment