|
▼かみちゃん さん:
こんばんは。
>
>Sub Sample()
> Dim rng As Range
> Dim c As Range
> Dim i As Integer
>
> On Error Resume Next
> Set rng = Rows("2:2").SpecialCells(xlCellTypeConstants, 23)
> On Error GoTo 0
>
> If Not rng Is Nothing Then
> rng.Select
'これ 0 Baseなら
ReDim vntData(rng.Count-1)
' とした方が良いですよね? 見ていたら、気になったので。
> i = 0
> For Each c In rng
> vntData(i) = c.Address(0, 0)
> i = i + 1
> Next
> Else
> MsgBox "2行目には値がありません"
> End If
> For i = 0 To UBound(vntData, 1)
> Debug.Print vntData(i)
> Next
>End Sub
私も考えました。
Sub main()
Dim g0 As Long
Dim myarray As Variant
myarray = Filter(Evaluate("if(2:2<>"""",address(2,column(2:2),4),""" & _
Chr(&HFF) & """)"), Chr(&HFF), False)
For g0 = LBound(myarray) To UBound(myarray)
MsgBox myarray(g0)
Next
End Sub
|
|