Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there any way to make a macro automatically "follow" changes to the
worksheet itself? For example, I might have a macro with an instruction such as Range("C5") = x But then I need to modify the sheet and insert columns and/or rows that requires the value 'x' to now appear in G9 but I have to manually change the macro instructions. I'm sure that there must be a way to avoid this hassle but how? TIA Stella |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use a Named Range:
Let's say that in the worksheet we created the name benine for =Sheet1!$B$9 the macro: Sub ordinate() MsgBox (Range("benine").Value) MsgBox (Range("benine").Address) End Sub will display the contents and address of B9. If you insert rows before B9, the name in the worksheet will automatically adjust and the macro will track to the new cell. -- Gary''s Student "Stella" wrote: Is there any way to make a macro automatically "follow" changes to the worksheet itself? For example, I might have a macro with an instruction such as Range("C5") = x But then I need to modify the sheet and insert columns and/or rows that requires the value 'x' to now appear in G9 but I have to manually change the macro instructions. I'm sure that there must be a way to avoid this hassle but how? TIA Stella |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
auto-hide rows, cell format (# and @), update cell refs, shade cel | Excel Discussion (Misc queries) | |||
returning absolute cell refs | Excel Discussion (Misc queries) | |||
Vlookup refs a cell that has a worksheet name | Excel Worksheet Functions | |||
How do I fix cell refs when adding rows | Excel Discussion (Misc queries) | |||
Variable Cell Refs | Excel Programming |