Macro to Search w/ PREDEFINED info, 99% done

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
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top