Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Relativity with a macro

If I create a macro to automatically print a total row, and then I manipulate
that row i.e. move it, add columns, whatever, will the macro adjust to all
changes and run correctly?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default Relativity with a macro

No it won't unfortunately, if you tell it to print a defined area like A1:C1
it will do just that, you would have to manually change the code,
Regards,
Alan
"Mary jane" wrote in message
...
If I create a macro to automatically print a total row, and then I
manipulate
that row i.e. move it, add columns, whatever, will the macro adjust to all
changes and run correctly?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Relativity with a macro

It will if you create a dynamic named range and reference that named range in
the macro.
Info on dynamic named ranges he
http://www.ozgrid.com/Excel/DynamicRanges.htm

Dave

--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Mary jane" wrote:

If I create a macro to automatically print a total row, and then I manipulate
that row i.e. move it, add columns, whatever, will the macro adjust to all
changes and run correctly?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Relativity with a macro

No it will not. You will need to use a named range, Indirect, or Offset
(there may be other options as well, but one of those three should work).


"Mary jane" wrote in message
...
If I create a macro to automatically print a total row, and then I
manipulate
that row i.e. move it, add columns, whatever, will the macro adjust to all
changes and run correctly?

Thanks



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Relativity with a macro

Did you create a Sub or a Function? If you have only one value that is
returned, then it is best to use the Function rather than a sub. I would be
best if you had a function where you referenced the cell by passing them into
the functions as parameters. then everything would be updated as you changed
you spreadsheet.

"Mary jane" wrote:

If I create a macro to automatically print a total row, and then I manipulate
that row i.e. move it, add columns, whatever, will the macro adjust to all
changes and run correctly?

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default Relativity with a macro

That true of course, but as I understood the original question, it was can
you set up a code event which will change the ranges set in the code to
accommodate changes in the worksheet regarding altering the range it refers
to.
You cant in VB, and if you need to alter a named range then what's the
difference? It still won't change, you have to alter it manually,
Regards,
Alan.
"Dave F" wrote in message
...
It will if you create a dynamic named range and reference that named range
in
the macro.
Info on dynamic named ranges he
http://www.ozgrid.com/Excel/DynamicRanges.htm

Dave

--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Mary jane" wrote:

If I create a macro to automatically print a total row, and then I
manipulate
that row i.e. move it, add columns, whatever, will the macro adjust to
all
changes and run correctly?

Thanks


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
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM
cells lose relativity to other WorkSheets after data sort? Ed Murray - ALPCO Excel Worksheet Functions 1 November 8th 04 07:02 PM


All times are GMT +1. The time now is 09:25 AM.

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"