AndresHernando
asked on
Excel VBA - Code for getting the name of a cell?
I'm trying to write code that will return the user names that have been given to cells.
What I tried below gives cell names like 'Sheet1'!$B$10
I actually need the name that has been given to that cell, which in this case happens to be "db1_Rd_PPRnum" (that is, the Name Manager name, not the cell reference)
Sub M_CellNames_Td_db1_CommonI nfo()
Dim rCell As Range
Dim rRangeWithNamedCells As Range
Set rRangeWithNamedCells = [Td_db1_CommonInfo]
For Each rCell In rRangeWithNamedCells
Cells([c_db1_CommonInfo_Ce llNames_Ce ll1].Row, rCell.Column).Value = rCell.Name
Next rCell
End Sub
What I tried below gives cell names like 'Sheet1'!$B$10
I actually need the name that has been given to that cell, which in this case happens to be "db1_Rd_PPRnum" (that is, the Name Manager name, not the cell reference)
Sub M_CellNames_Td_db1_CommonI
Dim rCell As Range
Dim rRangeWithNamedCells As Range
Set rRangeWithNamedCells = [Td_db1_CommonInfo]
For Each rCell In rRangeWithNamedCells
Cells([c_db1_CommonInfo_Ce
Next rCell
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nice!!!!
Thanks, --Andres