読者です 読者をやめる 読者になる 読者になる

VBA格納庫

Sub 表まとめ()

Dim i As Integer
Dim j As Integer
Dim cnt As Integer
Dim Str As String
Dim Tmp As String


For i = 2 To 100
cnt = 2
Str = Cells(i, 1).Value
' Debug.Print Cells(i, 1).Value
Sheet2.Cells(i, 1) = Cells(i, 1).Value
Str = ""
If Cells(i, 1).Value = "" Then
Exit For
End If

For j = 2 To 100
If Cells(i, j).Value = "-" Then
' Debug.Print Cells(1, j).Value
Sheet2.Cells(i, cnt) = Cells(1, j).Value
cnt = cnt + 1

Else
If Cells(i, j).Value = "" Then
Exit For
Else
End If

End If
Next
Next


End Sub