adding column to workbook with macros

T

Tim

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

Gary''s Student

Say C1 contains "hello"

running:

Sub test()
MsgBox (Range("C1").Value)
End Sub

will echo that contents

If you add a column at the beginning of the worksheet, the macro will not
adjust.

Running the macro will no longer greet you. (But there is a way around this)
 
E

Earl Kiosterud

Tim,

Macro cell references don't adjust as do formula cell references. You can use range names
in your macros instead of hard cell references. The references for those names will adjust.
Insert - Name - Define (or just type a name into the name box).
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
 
Top