ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Recording (https://www.excelbanter.com/excel-programming/434091-recording.html)

OldManEd

Recording
 
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


JP[_4_]

Recording
 
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

On Sep 24, 2:46*pm, "OldManEd" wrote:
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



OldManEd

Recording
 
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


"JP" wrote in message
...
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

On Sep 24, 2:46 pm, "OldManEd" wrote:
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



Otto Moehrbach[_2_]

Recording
 

"OldManEd" wrote in message
...
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


"JP" wrote in message
...
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

On Sep 24, 2:46 pm, "OldManEd" wrote:
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





Otto Moehrbach[_2_]

Recording
 
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
"OldManEd" wrote in message
...
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


"JP" wrote in message
...
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

On Sep 24, 2:46 pm, "OldManEd" wrote:
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






All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com