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?
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?
If "Cell" is a defined name, then you shouldn't have to make any changes in
the code.
--
Regards,
Tom Ogilvy
"Adam" <[email protected]> wrote in message
news:[email protected]...
> 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?
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" <[email protected]> wrote in message
news:[email protected]...
> 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?
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" <[email protected]> wrote in message
> news:[email protected]...
> > 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?
>
>
>
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" <[email protected]> wrote in message
news:[email protected]...
> 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" <[email protected]> wrote in message
> > news:[email protected]...
> > > 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?
> >
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks