Dynamic name ranges in the name

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,428
Hello all

I set up a dynamic name range using.
=OFFSET($A$1,0,0,COUNTA($A:$A),1)

The real kicker is that the Name itself I would like to be Dynamic, I would like to use the value in cell A1.

Anyone have an ideas?

Ross
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Maybe something like (untested)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A1")) Is Nothing Then
        ActiveSheet.Names.Add Name:=Range("A1").Value, RefersTo:= _
        "=OFFSET($A$1,0,0,COUNTA($A:$A),1)"
    End If
End Sub

As an afterthought, I'm not sure that making the name dynamic is a good idea, any existing formula using the old name will fail after the change is made.
 
Last edited:
Upvote 0
Hello all

I set up a dynamic name range using.
=OFFSET($A$1,0,0,COUNTA($A:$A),1)

The real kicker is that the Name itself I would like to be Dynamic, I would like to use the value in cell A1.

Anyone have an ideas?

Ross

Also, what do you have in column A - just numbers or just text?
 
Upvote 0
Aladin Akyurek,

that is correct. But don't put too much time into it as a may approach the problem a different way.

Ross
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,707
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top