Sub t1()
Dim fNum As Collection
Dim num
Dim numStr As String
numStr = "全民VBA"
Set fNum = findNum(numStr)
For Each num In fNum
Range(num).Interior.ColorIndex = 0
Next num
End Sub
Function findNum(numStr)
Dim c As Range
Dim firstAddress As String
Dim numArr As Collection
Dim i As Long
Set numArr = New Collection
With Sheet1.Cells
Set c = .Find(numStr)
If Not c Is Nothing Then
firstAddress = c.Address
Do
numArr.Add c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Set findNum = numArr
End Function
Sub t1()Dim fNum As CollectionDim numDim numStr As StringnumStr = "全民VBA"Set fNum = findNum(numStr)For Each num In fNum Range(num).Interior.ColorIndex = 0Next numEnd SubFunction findNum...