How can I extract the cell reference eg. A1 or B1.. if I provide the value inside the cell .
Eg. if a value "hello" is stored inside A1 , then if I provide hello I should be able to get A1 as output.
How can I extract the cell reference eg. A1 or B1.. if I provide the value inside the cell .
Eg. if a value "hello" is stored inside A1 , then if I provide hello I should be able to get A1 as output.
If using Excel-VBA, you can achieve this using the .Find method as illustrated below:
Sub FindValue()
Dim ws As Worksheet: Set ws = Worksheets("Sheet1")
'declare and set the worksheet, amend as required
Dim FoundVal As Range
'declare variable as range
Set FoundVal = ws.Cells.Find(What:="hello", LookAt:=xlWhole)
'find the value
If Not FoundVal Is Nothing Then 'if value found then
MsgBox FoundVal.Address
End If
End Sub