ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   adding column to workbook with macros (https://www.excelbanter.com/excel-discussion-misc-queries/164946-adding-column-workbook-macros.html)

Tim[_6_]

adding column to workbook with macros
 
Sorry just posted to wrong group

If I add a column to an existing workbook/sheets...do I have to recreate
existing macros in that workbook..or will they 'auto-adjust' to the new
column inserted ?

The existing macros work on various columns with different functions

Thanks, Tim



Jim Thomlinson

adding column to workbook with macros
 
Macros will not auto adjust.
--
HTH...

Jim Thomlinson


"Tim" wrote:

Sorry just posted to wrong group

If I add a column to an existing workbook/sheets...do I have to recreate
existing macros in that workbook..or will they 'auto-adjust' to the new
column inserted ?

The existing macros work on various columns with different functions

Thanks, Tim




Gord Dibben

adding column to workbook with macros
 
Depends upon how your macro is written.

If hard-coded, they will not adjust.

If relatively-coded they should adjust.


Gord Dibben MS Excel MVP

On Tue, 6 Nov 2007 09:03:45 -0700, "Tim" wrote:

Sorry just posted to wrong group

If I add a column to an existing workbook/sheets...do I have to recreate
existing macros in that workbook..or will they 'auto-adjust' to the new
column inserted ?

The existing macros work on various columns with different functions

Thanks, Tim



JP[_3_]

adding column to workbook with macros
 
If your last column was C and you wrote "Range(Selection,
Selection.offset(3,1)).select" intending to select all the way to the
rightmost cell, your macro would then have a logic error once you
inserted a column.

But if you wrote "Range(Selection, Selection.end(xltoright)).select"
then it would always select the rightmost cell regardless.


HTH,
JP


On Nov 6, 11:03 am, "Tim" wrote:
Sorry just posted to wrong group

If I add a column to an existing workbook/sheets...do I have to recreate
existing macros in that workbook..or will they 'auto-adjust' to the new
column inserted ?

The existing macros work on various columns with different functions

Thanks, Tim





All times are GMT +1. The time now is 02:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com