Dynamic Naming of RANGE

dkaltsas

New Member
Joined
Nov 10, 2005
Messages
18
HELP!!!

Range("B11").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Names.Add Name:="CtrlAcctName", RefersTo:="=" & "Score Card" & "!" & _
ActiveRange


why can't I make this thing work???? I was trying to name the selected Rnage in the previous line!!! Any ideas???
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

dkaltsas

New Member
Joined
Nov 10, 2005
Messages
18
btadams said:
try changing ActiveRange to Selection.Address

unfortunately the named range, "CtrlAcctName" cannot be used further down as it is empty!!


This is what I am trying to do:

Range("B11").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Names.Add Name:="CtrlAcctName", RefersTo:="=" & "Score Card" & "!" & _
Selection.Address
Range(CtrlAcctName).Find(what:=AcctNumber).Activate
 

btadams

Well-known Member
Joined
Jan 6, 2003
Messages
1,936
does it have to be a dynamic range or could you use:

ActiveWorkbook.Names.Add Name:="CtrlAcctName", RefersTo:="=" & "Score Card" & "!" & _
Range("D11:D65536").Address
 

Watch MrExcel Video

Forum statistics

Threads
1,118,530
Messages
5,572,660
Members
412,481
Latest member
nhantam
Top