Vba For Each Array

[Solved] Vba For Each Array | Vb - Code Explorer | yomemimo.com
Question : vba for each array

Answered by : vastemonde

' For each in an array: elements are considered as variant
Dim stringArray(1 To 2) As String
stringArray(1) = "a"
stringArray(2) = "b"
Dim element As Variant
For Each element In stringArray Debug.Print element
Next element
' Or
Dim index As Long
For index = LBound(stringArray) To UBound(stringArray) Debug.Print stringArray(index)
Next index

Source : | Last Update : Tue, 16 Feb 21

Answers related to vba for each array

Code Explorer Popular Question For Vb