Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Give CurrentRegion a RangeName

Hi All.......

I would like to select a cell with code, say B14, and then be able to assign
a RangeName to it's "Current Region" without having to use cell references
for the Range because I never know how big the range will be for the
selected cell.

Any help would be appreciated.

Vaya con Dios,
Chuck, CABGx3



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Give CurrentRegion a RangeName

Sub NameThatRegion()
Dim r As Range
Set r = ActiveCell.CurrentRegion
r.Name = "alphaa"
End Sub

--
Gary''s Student - gsnu200901
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Give CurrentRegion a RangeName

Why vector through the variable?

Sub NameThatRegion()
ActiveCell.CurrentRegion.Name = "alpha"
End Sub

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
Sub NameThatRegion()
Dim r As Range
Set r = ActiveCell.CurrentRegion
r.Name = "alphaa"
End Sub

--
Gary''s Student - gsnu200901


  #4   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Give CurrentRegion a RangeName

Nice improvement Rick........thanks


Vaya con Dios,
Chuck, CABGx3



"Rick Rothstein" wrote in message
...
Why vector through the variable?

Sub NameThatRegion()
ActiveCell.CurrentRegion.Name = "alpha"
End Sub

--
Rick (MVP - Excel)


"Gary''s Student" wrote in
message ...
Sub NameThatRegion()
Dim r As Range
Set r = ActiveCell.CurrentRegion
r.Name = "alphaa"
End Sub

--
Gary''s Student - gsnu200901




  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Give CurrentRegion a RangeName

"Works fine, lasts a long time"

Many thanks "Gary''s Student"

Vaya con Dios,
Chuck, CABGx3


"Gary''s Student" wrote in message
...
Sub NameThatRegion()
Dim r As Range
Set r = ActiveCell.CurrentRegion
r.Name = "alphaa"
End Sub

--
Gary''s Student - gsnu200901





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
Testing For a RangeName JCS Excel Discussion (Misc queries) 3 August 13th 08 01:08 PM
union of RangeName Bob Phillips Excel Programming 1 October 20th 06 12:35 PM
Finding Row Numbers Within the RangeName Goofy Excel Programming 4 October 19th 06 09:42 AM
Give RELEVANT responses to questions. DO NOT give usless list pmartin Excel Worksheet Functions 2 July 6th 06 06:08 PM
RangeName blocks of data CLR Excel Programming 7 March 3rd 06 05:57 PM


All times are GMT +1. The time now is 05:25 PM.

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

About Us

"It's about Microsoft Excel"