I have the following code, trying to locate the same symbol in the range named newvar as the range i'm working with now. But even though I can find the symbol using Ctrl+F, the following code keeps giving me type mismatch error. Can someone help? Thanks!
Set newvar = Range(Cells(3, 1), Cells(65536,5))
begr = 3
endr = [h65536].End(xlUp).Row
Do While begr <= endr
If Application.CountIf(newvar, Cells(begr, 8)) <> 0 Then
CGSYM = Cells(begr, 8)
newvar.Find(What:=CGSYM, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Select
End If
begr = begr + 1
Loop
Set newvar = Range(Cells(3, 1), Cells(65536,5))
begr = 3
endr = [h65536].End(xlUp).Row
Do While begr <= endr
If Application.CountIf(newvar, Cells(begr, 8)) <> 0 Then
CGSYM = Cells(begr, 8)
newvar.Find(What:=CGSYM, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Select
End If
begr = begr + 1
Loop