Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating VB Code
Is there any way to automatically update the VB code when you add/delete
rows/columns in the worksheets or do I need to change all the Range("Cell") inputs that are affected by this change? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating VB Code
If "Cell" is a defined name, then you shouldn't have to make any changes in
the code. -- Regards, Tom Ogilvy "Adam" wrote in message ... Is there any way to automatically update the VB code when you add/delete rows/columns in the worksheets or do I need to change all the Range("Cell") inputs that are affected by this change? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating VB Code
You need to ensure that your code caters for however many rows there may be,
be it by using named ranges, maybe dynamic named ranges, or determining at run time how many rows/columns there are. -- HTH RP (remove nothere from the email address if mailing direct) "Adam" wrote in message ... Is there any way to automatically update the VB code when you add/delete rows/columns in the worksheets or do I need to change all the Range("Cell") inputs that are affected by this change? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating VB Code
In this case the code is created by a recorded macro, hence the code is e.g.
Range("C12") etc. I realize that this is what creates the problem since it does not update to Range("C13") when I add one row in the worksheet. Is there a way around this.? "Tom Ogilvy" skrev: If "Cell" is a defined name, then you shouldn't have to make any changes in the code. -- Regards, Tom Ogilvy "Adam" wrote in message ... Is there any way to automatically update the VB code when you add/delete rows/columns in the worksheets or do I need to change all the Range("Cell") inputs that are affected by this change? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating VB Code
select C12. In the name box type CellC (as an example). (or use
Insert=Name=Define, Name: CellC, RefersTo: =Sheet1!$C$12) In the recorded code, replace Range("C12") with Range("CellC") -- Regards, Tom Ogilvy "Adam" wrote in message ... In this case the code is created by a recorded macro, hence the code is e.g. Range("C12") etc. I realize that this is what creates the problem since it does not update to Range("C13") when I add one row in the worksheet. Is there a way around this.? "Tom Ogilvy" skrev: If "Cell" is a defined name, then you shouldn't have to make any changes in the code. -- Regards, Tom Ogilvy "Adam" wrote in message ... Is there any way to automatically update the VB code when you add/delete rows/columns in the worksheets or do I need to change all the Range("Cell") inputs that are affected by this change? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
Updating Source Code in Charts | Charts and Charting in Excel | |||
When updating a worksheet, how do I create a link updating the sa. | Excel Worksheet Functions | |||
Updating form labels from code in a module | Excel Programming |