joel said:
I'm an expert in VBA and often use the macro recorder to get me started
on a macro. Especially with commands I don't use often to get the
correct syntax. But I always modified the reocrded macro to remove the
Selection and Active properties.
The macro recorder tends to produce verbose code with excessive
selections and activations of objects that reflect what was done via
mouse or keyboard. Prior to XL2007 the resulting code was never very far
off being a valid executable but with a lot of dross.
The problem with some macro instructions is the recorder
activates/selects objects but doesn't correctly put the
activation/selection of an object into the macro.
XL2007 is a different kettle of fish. Apart from the banal and trivial
select a cell and grab contents it almost never produces valid code
leaving many important steps out and sometimes generating no code at
all. Beginners stand almost no chance of automating simple graph tasks.
You don't need to know VBA to use the recorder, but to get a macro that
is easily understandable and easy to upgrade you should always modifiy
and document the macro so you remember in the future what the macro
actual does. At least changge the name of the macro form Macro1 to
something that you will remember in the future.
The problem with XL2007 is that the macro recorder no longer works
correctly. That isn't such a big deal for an experienced programmer, but
it is a total menace for the average office user just wanting to speed
up some frequently done operation with a captured macro.
I stand by my assertion that in XL2007 the macro recorder is hopelessly
broken. YMMV
Regards,
Martin Brown