Answers for "Foreach vba"

VBA
0

Foreach vba

Dim MyObject As Variant, MyCollection As Variant
MyCollection = Array("Hello", "World")
For Each MyObject In MyCollection
	Debug.Print(MyObject)
Next
Posted by: Guest on September-14-2021
0

excel vba for each

Dim Found, MyObject, MyCollection 
Found = False    ' Initialize variable. 
For Each MyObject In MyCollection    ' Iterate through each element.  
    If MyObject.Text = "Hello" Then    ' If Text equals "Hello". 
        Found = True    ' Set Found to True. 
        Exit For    ' Exit loop. 
    End If 
Next
Posted by: Guest on January-22-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language