Offset by x

  • Thread starter Thread starter martin.a.john
  • Start date Start date
M

martin.a.john

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.
 
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
| 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.
|
 
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

--

| 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.
|

thanks for the response. This really helped me out. I have used many
references to this now. Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top