PDA

View Full Version : Search for a cell with this name assigned?



doctortt
11-27-2012, 10:36 AM
Hi, I assigned a name called HELLO in one cell. I'm having a hard time to come up with the codes that will search the entire worksheet to look for that cell with the name HELLO.

Afterward, I want Excel to give me the row number and column of cell HELLO. I can probably do this with msgbox.

Can someone please help me? I would much appreciate it.

GarysStudent
11-27-2012, 11:14 AM
You don't need to search:

Sub dural()
MsgBox Range("HELLO").Address
End Sub

doctortt
11-27-2012, 12:00 PM
Ohhh thanks a lot.

Just to follow up. How do I strip off the row number, then add 2 to it and store this new number to a string called TEMP

GarysStudent
11-27-2012, 12:06 PM
Like this:


Sub dural()
Dim TEMP As String
TEMP = CStr(Split(Range("HELLO").Address, "$")(2) + 2)
End Sub

doctortt
11-27-2012, 12:13 PM
Thanks a lot. Much appreciate it.