I have a workbook with a bunch of individual worksheets, that will continue to grow overtime. Each spreadsheet is a statement for billing for individuals and their may be similar names.
I have a "Search" button on the main worksheet page. I want to be able to enter text into cell "B3" and then click search and be taken to the page closest to what I type in. The workbook is sorted alphabetically so if I am taken to the first closest match I can search from there.
For example maybe I have two Smith, J worksheets (the second of which may be listed as Smith, J (2)). I want to be able to type in, "Sm", "Smi", "Smith" or "Smith, J" and be taken to the first "Smith" worksheet in the workbook.
Further if no matches come up, I would like there to be an message box that says that.
So far I have the following basics. I am not really sure where to go from here.
I have a "Search" button on the main worksheet page. I want to be able to enter text into cell "B3" and then click search and be taken to the page closest to what I type in. The workbook is sorted alphabetically so if I am taken to the first closest match I can search from there.
For example maybe I have two Smith, J worksheets (the second of which may be listed as Smith, J (2)). I want to be able to type in, "Sm", "Smi", "Smith" or "Smith, J" and be taken to the first "Smith" worksheet in the workbook.
Further if no matches come up, I would like there to be an message box that says that.
So far I have the following basics. I am not really sure where to go from here.
Code:
Sub Search_Sheets()
Dim SearchName As String
SearchName = ActiveSheet.Range("B3").Value
If SearchName <> "" Then
Sheets(SearchName).Select
Else
MsgBox "Terminate", vbOKOnly, "Error"
End If
End Sub