Hi,
In a part of my code I need to use a For Each Cell In Array("","","").. so I thought maybe I should dynamically do this using an array variable but i'm stuck..
What I'd like it to be is like something along the lines of below. The Sheet8.Cells is also defined as [UserRange] but I couldn't get this to work. Any help?
In a part of my code I need to use a For Each Cell In Array("","","").. so I thought maybe I should dynamically do this using an array variable but i'm stuck..
What I'd like it to be is like something along the lines of below. The Sheet8.Cells is also defined as [UserRange] but I couldn't get this to work. Any help?
Code:
Dim MyArr() as Variant
For I = 1 to 28
If Sheet8.Cells(I + 2, 4) = [MyName] then MyArr(I) = Sheet8.Cells(I + 2, 4)
Next I
For Each Cell In Array(MyArr)
CODE HERE
Next Cell