Thread: Offset by x
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Offset by x

Certainly you can use a variable in an offset:

Sub a()
Dim Counter As Integer
For Counter = 1 To 5
Range("A1").Offset(Counter).Value = Counter
Next
End Sub


--
Jim
wrote in message
oups.com...
| Is there a way for the offset function to work with an undefined value
| i.e. offset(x , 0) from an absolute cell.
|
| for example at the end of a loop x = x+4 to increment the offset by 4
| rows on each loop.
|
| As I have a problem with many relative references so cannot use
| activecell. the offset will always start from the same fixed position.
|