-1

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.

esqew
  • 42,425
  • 27
  • 92
  • 132
Anjali
  • 23
  • 1
  • 2
  • 5
  • 1
    Are you looking to have BluePrism find the address, or Excel VBA? (If BluePrism, I'd suggest removing the [excel-vba] tag.) – CLR Jun 19 '18 at 08:10

1 Answers1

1

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
Xabier
  • 7,587
  • 1
  • 8
  • 20