NumberCrunchingMonky
Technical User
I use the script below to search for names that appear in Column B of an excel worksheet. It's linked to a cell in which the name is typed. It works fine for a single name. However, if there are muliple records with the same name I cannot get it to "find next" when I hit the button a second time. It just stays on it's first "find". How do I build a "find next" condition in the script so the next record down with the same name gets selected?
Thanks.
NCM
Sub CommandButton1_Click()
Set FindIt = ActiveSheet.Range("B3:B" & ActiveSheet.Range("B1000").End(xlUp).Row).Find(Trim(ActiveSheet.Range("F1").Value))
If Not FindIt Is Nothing Then ActiveSheet.Range(FindIt.Address).Select
End Sub
Thanks.
NCM
Sub CommandButton1_Click()
Set FindIt = ActiveSheet.Range("B3:B" & ActiveSheet.Range("B1000").End(xlUp).Row).Find(Trim(ActiveSheet.Range("F1").Value))
If Not FindIt Is Nothing Then ActiveSheet.Range(FindIt.Address).Select
End Sub