I want to search in columns B,C,G only , I used below code:
Set findName = shWaseet.Range("B:C","G:G").Find(Me.SearchBox.Value, LookIn:=xlValues, Lookat:=xlPart)
and it takes only B & C columns, I try
Set findName = shWaseet.Range("B1:C" & irow, "G1:G" & irow).Find(Me.SearchBox.Value, LookIn:=xlValues, Lookat:=xlPart)
and it didn't work, I know I have to use UNION, but I don't know how to use it with find, I tried:
Dim ran As Range
Set ran = Union(Range("B:C"), Range("G:G"))
Set findName = shWaseet.Range(ran).Find(Me.SearchBox.Value, LookIn:=xlValues, Lookat:=xlPart)
and it throws an error, also I tried:
Set findName = shWaseet.Union(Range("B:C"), Range("G:G")).Find(Me.SearchBox.Value, LookIn:=xlValues, Lookat:=xlPart)
and nothing. how to achieve that?