Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
cells lose relativity to other WorkSheets after data sort? | Excel Worksheet Functions |