Return cell value with an address

Viewed 112

I have a cell adress after a find fonction :

YOLO = Worksheets("Adobe Reader").Range("A1:A500").Find("YOLO").Address 'Exemple : $A$131

And when I try to show the Value of the adress range, it show only the adress :

Worksheets("Caracteristiques").Range("B1").Value = Worksheets("Adobe Reader").Range("YOLO").Value

In range B1 i have $A$131. How can I get the cell value instead ?

1 Answers

How about doing it slightly differently like below:

Dim YOLO As Range
Set YOLO = Worksheets("Adobe Reader").Range("A1:A500").Find(What:="YOLO" LookAt:=xlPart) 
'or LookAt:=xlWhole if the full content of the cell
If Not YOLO is Nothing Then Worksheets("Caracteristiques").Range("B1").Value = YOLO.Value 
'or to get the address (YOLO.Address)
Related