Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Roger D
 
Posts: n/a
Default How do I change a macro to use relative cell addresses?

When I record a macro, it uses absolute cell addresses. How do I change the
macro to run from a specific cell and relative to that cell?
  #2   Report Post  
Don Guillett
 
Posts: n/a
Default

try
activecell.offset(1,2)

However, I suspect you are using a lot of SELECTIONS which usually aren't
necessary. Why not copy/paste your code here along with an explanation of
what you are trying to do.
--
Don Guillett
SalesAid Software

"Roger D" <Roger
wrote in message
...
When I record a macro, it uses absolute cell addresses. How do I change

the
macro to run from a specific cell and relative to that cell?



  #3   Report Post  
bornjuice
 
Posts: n/a
Default

The only forms I know you can introduce relative references into a
Macro is....

a) using ActiveCell.Offset(R,C), where + is rows below or columns ahead
and - is rows above or columns before. Obviously you had to define R
and C before in the Macro or into the expression as a solid number.

b) sometimes works som others don=B4t...
Range with the cells method in this way:
Range(Cells(R,C)) or Range(Cells(Ri,Ci),Cells(Re,Ce)), where subscript
"i" referes to initial and "e" refres to end of a range of cells. Same
asumptions about relative references for each one as described before.

Hope it helps...

Alvaro Silva
TMMQ



Don Guillett wrote:
try
activecell.offset(1,2)

However, I suspect you are using a lot of SELECTIONS which usually aren't
necessary. Why not copy/paste your code here along with an explanation of
what you are trying to do.
--
Don Guillett
SalesAid Software

"Roger D" <Roger
wrote in message
...
When I record a macro, it uses absolute cell addresses. How do I change

the
macro to run from a specific cell and relative to that cell?


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
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Perform oiperations relative to initial selected cell scratching my head Excel Discussion (Misc queries) 1 May 30th 05 05:42 PM
Relative Macro Help on Keystrokes Neal Zimm Excel Discussion (Misc queries) 9 December 15th 04 12:31 AM
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 3 December 13th 04 08:43 PM
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 1 December 13th 04 07:55 PM


All times are GMT +1. The time now is 03:10 PM.

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

About Us

"It's about Microsoft Excel"