G
Guest
I have figured out how to search rows in a worksheet and display only rows
that contain text that matches the users input (the code is below). What I am
not able to figure out is how to display rows with text containing text that
the user inputs into the inputbox. I tried putting the * in front of the text
in the inputbox but that does not work. Any help would be greatly appreciated.
Dim r As Range
ActiveWorkbook.Worksheets(1).Range("A1").Select
v = UCase(Application.InputBox("Enter Course Number:", "Course", Type:=2))
Rows.Range("Courses").EntireRow.Hidden = True
For Each r In ActiveSheet.UsedRange
If InStr(r.Value, v) <> 0 Then
Rows(r.Row).EntireRow.Hidden = False
End If
Next
Cells(1, 1).Select
End Sub
that contain text that matches the users input (the code is below). What I am
not able to figure out is how to display rows with text containing text that
the user inputs into the inputbox. I tried putting the * in front of the text
in the inputbox but that does not work. Any help would be greatly appreciated.
Dim r As Range
ActiveWorkbook.Worksheets(1).Range("A1").Select
v = UCase(Application.InputBox("Enter Course Number:", "Course", Type:=2))
Rows.Range("Courses").EntireRow.Hidden = True
For Each r In ActiveSheet.UsedRange
If InStr(r.Value, v) <> 0 Then
Rows(r.Row).EntireRow.Hidden = False
End If
Next
Cells(1, 1).Select
End Sub