Hey Guys,
I looking for solution when I want to search text in Cell D6 in column D. But the word could be in several cells and I need to add The Next function to search (Search and find next cell with text from cell D6).
Can you please help me with this ?
THX
I looking for solution when I want to search text in Cell D6 in column D. But the word could be in several cells and I need to add The Next function to search (Search and find next cell with text from cell D6).
Code:
Sub Hledat1()
Dim rfoundCell As Range
'Searching text from cell D6
X = Range("D6").Value
' Search range is column D
Set rfoundCell = Range("D7:D10000").Find(what:=X, LookIn:=xlValues, lookat:=xlPart)
If Not rfoundCell Is Nothing Then
' After found text in cell, select the cell and show message
rfoundCell.Select
MsgBox "Searched word: " & X & vbCrLf & "was found in cell: " & rfoundCell.Address(0, 0)
Else
MsgBox "Searched word: " & X & vbCrLf & " was not found"
End If
End Sub
Can you please help me with this ?
THX