View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Arrays problem in new filtering code

You can nest For..Next loops if needed. For example, consider this example
macro which fills in cells on the active sheet showing which loop variable
is active at which time through the loops...

Sub test()
Dim X As Long
Dim Y As Long
For X = 1 To 5
For Y = 100 To 110
Range("A1").Offset(X - 1, Y - 100).Value = "X = " & X & ", Y = " & Y
Next
Next
End Sub

--
Rick (MVP - Excel)


"Steve" wrote in message
...
Thanks Rick. This is my first attempt at using an array. I have only been
programming spreadsheets for a while. I tried a few other ways around it
but
things ran slow or did not work. I knew more or less what an array was,
but I
wasn't sure the best way t use them. I know that Do...Loop looked funny,
it
as mostly because I was more concerned with making my array work right. If
you noticed the GetLimit() function in there, that is another loop I used
that looks just as bad as the one you saw. All it does is allow me to
ReDim
my array, I'm use you gathered that though. At one point both loops used
For
loops, but then all sense left me as I tried to get that array to fill up
the
way I wanted.