lonewolf9899
New Member
- Joined
- Jul 26, 2010
- Messages
- 18
Hi; I have a spreadsheet with data that looks like this;
CSR 01
CSR 02
CSR 03
What I would like is to create a Search macro that asks the user to input what CSR number they are looking for (01, 02, etc). However, the spreadsheet has LOTS of numbers, so the search function MUST search for the letters CSR as well as the 2 digit number. I have the below macro to ask for the 2 digit number, but I cant figure out how to get it to include the "CSR" in the search (I do not want users to have to type "CSR" and the number, I want them to only have to type the number).
Sub Part_Number_Search()
Dim SearchValue As String
On Error Resume Next
SearchValue = InputBox("Enter CSR Number")
If IsError(Cells.Find(What:=SearchValue, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate) = True Then
MsgBox ("CSR Number Not Found")
End If
End Sub
CSR 01
CSR 02
CSR 03
What I would like is to create a Search macro that asks the user to input what CSR number they are looking for (01, 02, etc). However, the spreadsheet has LOTS of numbers, so the search function MUST search for the letters CSR as well as the 2 digit number. I have the below macro to ask for the 2 digit number, but I cant figure out how to get it to include the "CSR" in the search (I do not want users to have to type "CSR" and the number, I want them to only have to type the number).
Sub Part_Number_Search()
Dim SearchValue As String
On Error Resume Next
SearchValue = InputBox("Enter CSR Number")
If IsError(Cells.Find(What:=SearchValue, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate) = True Then
MsgBox ("CSR Number Not Found")
End If
End Sub