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
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