LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Relative cell position in VBA

When I am writing a formula in VBA how do I refer to a cell relatively rather
than an exact cell?

For example:
Range("B1").Select
Selection.End (xlDown)
ActiveCell.Offset(1, 7).Select

This puts me in cell in column "I" but the row is unknown to me. Now I want
to write a formula that adds the numbers in columns B-D and subtracts the
number in column J of the same line into column I. How do I reference cells
on the same row but in different columns when I do not know the row number?
And, can this be adjusted if I know the row number but the column is relative?
 
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
Position drawing object relative to cell Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 2 September 29th 08 09:16 PM
How to macro to relative position jk9533 Excel Discussion (Misc queries) 6 October 15th 07 08:11 PM
Displaying a cell relative to the position to another cell Tibbs Excel Discussion (Misc queries) 2 July 21st 06 08:28 AM
Relative Cell position NOT working with or without macro Scratching my Head Excel Discussion (Misc queries) 6 May 30th 05 06:12 PM
Create cell formula from a relative position Geoff[_11_] Excel Programming 3 May 26th 05 06:42 PM


All times are GMT +1. The time now is 07:33 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"