range.find的结果还有什么其他的select?

在Excel VBA中,当您执行range.find时,您可以获得result.address。 除了.address之外,还有其他的选项可以从结果中得到吗? 我无法find用于在Google上search的字词。 如果我们可以得到像result.col之类的其他信息,那就太好了。 其他选项不显示在代码窗口中的结果。

你可以使用结果来rest。 例如,如果您使用下面的代码,并且如果您find一个匹配,那么您可以得到其余的细节。 看截图。

Sub Sample() Dim oSht As Worksheet Dim strSearch As String Dim aCell As Range On Error GoTo Err '~~> Set this to the relevant sheet Set oSht = Sheets("Sheet1") '~~> Search String strSearch = "Sid" '~~> Do the Find Set aCell = oSht.Cells.Find(What:=strSearch, LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) '~~> If Found If Not aCell Is Nothing Then Debug.Print aCell.Row '<~~ Give the Row Debug.Print aCell.Column '<~~ Gives the Column '~~> AND SO ON End If Exit Sub Err: MsgBox Err.Description End Sub 

截图

在这里输入图像说明

小费

你可能会发现这是一个有趣的阅读。