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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acessing name box labels

Status
Not open for further replies.

andyhutch119

Programmer
Nov 5, 2003
8
GB
hi
I've created a spreadsheet that populates data from an access data base which stores time_sheet details for staff. The first column/row holds the persons name,also I use the name box to store the their employee number using this code
'// Insert Label reference for each team member
Range(.Cells(introw, mintStartcol), _
.Cells(introw, mintStartcol)).Select
ActiveWorkbook.Names.Add Name:="Empid_1221" _
, RefersToR1C1:= _
Range(.Cells(introw, mintStartcol), _
.Cells(introw, mintStartcol))
Is there a way to access the name for this cell "Empid_1221" if I know the row and column so as to assign it to a variable in my procedure

Thanks for any help
 
A starting point:
For Each n In ActiveWorkbook.Names
If n.RefersTo = Cells(row,column).Name.RefersTo Then
MsgBox n.Name
End If
Next

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 


Hi,

If, as you illustrated, you already assigned the name to that range (row, col), then, Cells(row, col).Value IS the range name.

Skip,

[glasses] [red]Sign above the facsimile apparatus at the music publisher:[/red]
If it ain't baroque...
Don't FAX it![tongue]
 
Really Skip ?
In XL2003, french version, debug window:
? Cells(4,4).Value
azerty
? Cells(4,4).Name
=Feuil1!$D$4
? ActiveWorkbook.Names("myRange").RefersTo
=Feuil1!$D$4

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

[blush]You're correct[blush]

Skip,

[glasses] [red]Sign above the facsimile apparatus at the music publisher:[/red]
If it ain't baroque...
Don't FAX it![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top