|
▼Jto さん:
アップされたコードではなく質問文が正しいとしていくつか。
(名前の定義のコードは割愛しています)
Sub Sample1()
Dim R As String
Dim i As Long
R = Range("A2").Address(False, False)
For i = 6 To 18 Step 4
R = R & "," & Cells(i, "A").Address(0, 0)
Next i
MsgBox R
End Sub
Sub Sample2()
Dim R As String
Dim i As Long
Dim sep As String
For i = 2 To 18 Step 4
R = R & sep & Cells(i, "A").Address(0, 0)
sep = ","
Next i
MsgBox R
End Sub
Sub Sample3()
Dim R As String
Dim i As Long
Dim k As Long
Dim v(1 To 5) As String
For i = 2 To 18 Step 4
k = k + 1
v(k) = Cells(i, "A").Address(0, 0)
Next i
R = Join(v, ",")
MsgBox R
End Sub
|
|