Give CurrentRegion a RangeName

C

clr

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
 
G

Gary''s Student

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

Rick Rothstein

Why vector through the variable?

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

clr

"Works fine, lasts a long time"

Many thanks "Gary''s Student"

Vaya con Dios,
Chuck, CABGx3
 

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

Top