ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Need Help With Formula/Function (https://www.excelbanter.com/excel-worksheet-functions/73981-need-help-formula-function.html)

scchang

Need Help With Formula/Function
 

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


R..VENKATARAMAN

Need Help With Formula/Function
 
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" wrote in
message ...

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





scchang

Need Help With Formula/Function
 

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!


--
scchang
------------------------------------------------------------------------
scchang's Profile: http://www.excelforum.com/member.php...o&userid=31937
View this thread: http://www.excelforum.com/showthread...hreadid=516615



All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com