#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Offset by x

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
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.
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Offset by x

On 2 May, 18:29, "Jim Rech" wrote:
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

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


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul RyGuy Excel Worksheet Functions 2 September 28th 07 10:54 PM
Find, Copy offset to offset on other sheet, Run-time 1004. Finny[_3_] Excel Programming 10 December 7th 06 11:46 PM
select offset (variable ,1) to offset(variable ,variable) Buffyslay Excel Programming 1 November 15th 06 11:45 AM
Problem with Range.Cells.Offset and Range.Cells( row + offset, column) [email protected] Excel Programming 2 August 22nd 05 05:25 AM
offset Larry Excel Worksheet Functions 4 May 12th 05 04:10 AM


All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"