adding column to workbook with macros

T

Tim

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
 
G

Gord Dibben

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
 
J

JP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top