#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recording Macro carrera Excel Discussion (Misc queries) 2 March 14th 08 02:07 PM
Macro recording MM[_3_] Excel Discussion (Misc queries) 9 March 2nd 08 12:03 PM
How do I make the Stop Recording bar pop up when recording macros J Excel Worksheet Functions 1 January 10th 06 08:46 PM
Recording changes gibbylinks Excel Discussion (Misc queries) 2 December 5th 05 12:59 PM
recording No Name Excel Programming 2 July 29th 04 02:33 PM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"