VBA Autofilter multiple columns with input box

CleverTiger

New Member
Joined
Nov 26, 2012
Messages
3
I have written a macro that uses an input box to search a column. To make it more user friendly I've added an additional column with tags in case the user doesn't input the exact verbage in the input search box. how do i get the macro to look into column 2 (B) AND column 5 (E) for it's search?

my code is as follows:
Sub Find_Problem()
Worksheets("Problem Entry").Activate
Dim Message, Title, Default
Dim MyValue As String
Message = "Enter brief problem description" ' Set prompt.
Title = "Troubleshoot Search" ' Set title.
Default = "" ' Set default.
' Display message, title, and default value.

Worksheets("Data").Range("$A$5:$E$251").AutoFilter Field:=2
MyValue = InputBox(Message, Title, Default, 6900, 5800)
Myvalue1 = "*" & MyValue & "*"
Worksheets("Data").Range("A1").AutoFilter Field:=2, Criteria1:=Myvalue1

Worksheets("Data").Select
End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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