View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Negnog Negnog is offline
external usenet poster
 
Posts: 1
Default Walking Through Cells Using a Loop

BEGINNER'S QUESTION:
I am creating an application in Excel that will use a block of cells for
display - 9 rows and 9 columns - A1-A9, B1-B9, ..., I1-I9. In several
places, I would like to look at or write to each cell using a FOR loop in VBA:

FOR row=1 to 9
FOR col=1 TO 9
write to cell at (row, col)
NEXT col
NEXT row

How do I create cell references dynamically in a loop based on "row" and
"col"? Is there a better way to programatically cycle through a series of
cells other than using FOR loops?

Thank you.