Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Updating Source Code in Charts University Charts and Charting in Excel 0 September 19th 06 08:12 PM
When updating a worksheet, how do I create a link updating the sa. Phlashh Excel Worksheet Functions 9 January 27th 05 06:05 PM
Updating form labels from code in a module news.verizon.net[_2_] Excel Programming 2 October 29th 03 04:03 AM


All times are GMT +1. The time now is 12:54 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"