Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
KDJ KDJ is offline
external usenet poster
 
Posts: 19
Default Assigning name to current region

Hello

After selecting the current region, I would like to assign the name
Total_Statistic. The region can change and the name should be overwritten
each time I run the macro.

I am selecting the region as follows:

Set tbl = ActiveCell.CurrentRegion
tbl.Select

I can't find the right VBA command to assign a name, given that this isn't a
cell reference. Would really appreciate some help!
--
Thanks very much. KDJ
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Assigning name to current region


Hi KDJ,

Try something like:

Public Sub Tester03a()
Dim tbl As Range

Set tbl = ActiveCell.CurrentRegion()

ActiveWorkbook.Names.Add _
Name:="Total_Statistic", _
RefersTo:=tbl
End Sub

---
Regards,
Norman



"KDJ" wrote in message
...
Hello

After selecting the current region, I would like to assign the name
Total_Statistic. The region can change and the name should be overwritten
each time I run the macro.

I am selecting the region as follows:

Set tbl = ActiveCell.CurrentRegion
tbl.Select

I can't find the right VBA command to assign a name, given that this isn't
a
cell reference. Would really appreciate some help!
--
Thanks very much. KDJ



  #3   Report Post  
Posted to microsoft.public.excel.programming
KDJ KDJ is offline
external usenet poster
 
Posts: 19
Default Assigning name to current region

Thanks again, Norman ... you've saved my Monday

KDJ


"Norman Jones" schrieb:


Hi KDJ,

Try something like:

Public Sub Tester03a()
Dim tbl As Range

Set tbl = ActiveCell.CurrentRegion()

ActiveWorkbook.Names.Add _
Name:="Total_Statistic", _
RefersTo:=tbl
End Sub

---
Regards,
Norman



"KDJ" wrote in message
...
Hello

After selecting the current region, I would like to assign the name
Total_Statistic. The region can change and the name should be overwritten
each time I run the macro.

I am selecting the region as follows:

Set tbl = ActiveCell.CurrentRegion
tbl.Select

I can't find the right VBA command to assign a name, given that this isn't
a
cell reference. Would really appreciate some help!
--
Thanks very much. KDJ




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
Current region emulation daverau Excel Worksheet Functions 5 October 16th 09 04:31 AM
Copy Current Region Rohit Thomas[_2_] Excel Programming 1 December 4th 03 01:55 AM
how to fill gaps in Current Region? Mikhail Excel Programming 4 November 11th 03 02:26 PM
Naming Current Region Gavin[_4_] Excel Programming 3 October 14th 03 03:38 PM


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

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"