View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Freeman
 
Posts: n/a
Default Looping in VB with cell ranges

I have a function that brings in four different cell ranges:
ie: Total(AccountRange As Range, DateRange As Range, etc...)

Within the VB function I have a For/Next Loop as follows:
ie: For Each cell in AccountRange
"multiple if statements"
Next cell

I want to increment the rows in the other cell ranges during the looping
process. When the AccountRange row increases during the "Next cell" call
then I want the other ranges to follow suit.

By the way what actually happens during the looping process for a range of
cells? If the range is 2 columns by 4 rows does the "Next cell" call go down
the rows then jump to the top of the 2nd column and again proceed down the
rows??