Looking for a way to search a worksheet for a given value and return the column and row header value(s) for the found cell(s). Any help appreciated!
Looking for a way to search a worksheet for a given value and return the column and row header value(s) for the found cell(s). Any help appreciated!
try something like this
Public Sub test()
Dim cfind As Range
Set cfind = Cells.Find(what:="h") 'h is the value you want to find.
change this
MsgBox "the coumn header is " & cfind.End(xlUp)
MsgBox "the row header is " & cfind.End(xlToLeft)
End Sub
"scchang" <scchang.23tqpa_1140936602.3981@excelforum-nospam.com> wrote in
message news:scchang.23tqpa_1140936602.3981@excelforum-nospam.com...
>
> Looking for a way to search a worksheet for a given value and return the
> column and row header value(s) for the found cell(s). Any help
> appreciated!
>
>
> --
> scchang
> ------------------------------------------------------------------------
> scchang's Profile:
> http://www.excelforum.com/member.php...o&userid=31937
> View this thread: http://www.excelforum.com/showthread...hreadid=516615
>
That worked. Thanks.
To expand, how would I modify this to find all occurrences of "h" and return specific row and column values for each occurence in table form?
Appreciate your help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks