Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to name an Excel range 1

Status
Not open for further replies.

Groves22

Technical User
Jan 29, 2009
102
US
Hello all...
I writing a macro, and I need it to name a specific range a name. The range changes daily in length. Here is what I have:

Code:
Range(Sheets(5).Cells(6, 6).End(xlDown)).Name = "unique_producer_list"

and I get this error:
" run-time error '1004'
Method 'Range' of object '_Global' failed"

Any ideas?
Thanks!
 

hi,
Code:
Sheets(5).Cells(6, 6).End(xlDown).Name = "unique_producer_list"

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 



CAVEAT: That range is ONE CELL, not the LIST.

The LIST is...
Code:
Range(Sheets(5).Cells(6, 6), Sheets(5).Cells(6, 6).End(xlDown)).Name = "unique_producer_list"


Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top