How to find the address of a cell

  • Thread starter Thread starter Annie Creissac
  • Start date Start date
A

Annie Creissac

Hello,
I would like to know if a function, such as describe
below, exists in Excel.
I would like to recuperate in another cell the address of
cell (e.g. B23) testing with the content of the cell.
For example find in the spread sheet 'Toto' and give me
the address where you find it e.g. B45.
Thank you in advance.
 
We cannot use Find in a custom function, so some sort of normal macro i
required.

This is the basic code :-


Code
-------------------
Sub Get_Address()
v1 = "toto"
Set FoundCell = ActiveSheet.Cells.Find(v1)
If FoundCell Is Nothing Then
FoundVal = "NotFound"
Else
FoundVal = FoundCell.Address
End If
MsgBox (FoundVal)
End Sub
 
Or

Sub findtoto()
On Error Resume Next
MsgBox Cells.Find("TOTO").Address
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top