Recording

O

OldManEd

I use a macro that contains the following line.

Range("A1").CurrentRegion.Name = "PriceTable"

This line was edited manually to insert the 'CurrentRegion' part. It
originally had a named range like A1:F25.

Can this line be recorded? How in both Excel 2003 and 2007?



OldEd
 
J

JP

Unfortunately not, the macro recorder will hard code whatever range is
selected. Naming a range by using the current region (whatever it is)
must be done by writing VBA code.

--JP
 
O

OldManEd

Thanks. Expected that might be the case.

What does the macro recorder do with the following key/mouse strokes?

Open .........
Save as xxxx.xls
Control A
Type 'PruceTable' in range name box (top left)
Save
Stop recorder.

Will control-A select everything that the 'CurrentRegion' does and then give
it a name?

ed


Unfortunately not, the macro recorder will hard code whatever range is
selected. Naming a range by using the current region (whatever it is)
must be done by writing VBA code.

--JP
 
O

Otto Moehrbach

OldManEd said:
Thanks. Expected that might be the case.

What does the macro recorder do with the following key/mouse strokes?

Open .........
Save as xxxx.xls
Control A
Type 'PruceTable' in range name box (top left)
Save
Stop recorder.

Will control-A select everything that the 'CurrentRegion' does and then
give it a name?

ed


Unfortunately not, the macro recorder will hard code whatever range is
selected. Naming a range by using the current region (whatever it is)
must be done by writing VBA code.

--JP
 
O

Otto Moehrbach

After you record that macro, hit the F5 key, select the PruceTable name and
click OK. That will highlight the range that bears that name. HTH Otto
 

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

Similar Threads


Top