获取函数中单元格的地址。find

我有像下面的代码,我想获得单元格的值,如果find值的地址。 因为如果macros在SomeRange中find现有的值,我想改变这个单元格的值。

Range(SomeRange).Select Set a = Selection.Find(What:=Something, After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) 

你需要防止找不到任何东西。

 dim a as range Range(SomeRange).Select on error resume next Set a = Selection.Find(What:=Something, After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) if not a is nothing then debug.print a.address(0, 0) a = "changed value" end if