View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
wmureports wmureports is offline
external usenet poster
 
Posts: 14
Default Adding a counter to ranges

What i want to do is insert data into a range of rows. But instead of
staticly typing the rows I want them to be determined dynamically
through a counter variable. Heres and example of my code.

Dim counter As Integer

counter = 0

Do While counter < 20
counter = counter + 1

ThisWorkbook.Worksheets("Sheet1").Range("A1:A20") = counter
Loop


So instead of A1:A20 It will be A*counter value*:A*counter value*. My
problem is I dont know the proper syntax to add the actual counter
variable into to range