返回带有地址的单元格值

时间:2018-11-15 10:12:06

标签: excel vba excel-vba excel-2016

找到连接后,我有一个手机地址:

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

当我尝试显示地址范围的值时,它仅显示地址:

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

在范围B1中,我有$ A $ 131。我该如何获取单元格值?

1 个答案:

答案 0 :(得分:4)

如何做,如下所示:

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)