Visual Basic 6.5 in Excel

M

mrogge2895

When modiifying a macro recorded in excel, is there a way to program the code
to automatically recognize changes made within sheets used within the macro?
For example, if I record a macro, and later, I add a row above or below a
cell used within the macro, is there a way to force the macro to understand
the change in the cell reference as a result of adding the row? Currently,
whenever I write a macro, and subsequently add rows, the macro will not
execute due to the movement of the cell references from their original
location. I am trying to find out if this can be fixed in the programming.

Thanks.
 
G

Gary''s Student

The usual way is to define a Named range in the worksheet and use that Name
in the VBA code. As you insert/remove rows/columns, the Name will adjust.
 

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