LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Showing rows containing text

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing all rows in a pivot table [email protected] Excel Discussion (Misc queries) 2 April 25th 09 04:51 PM
Showing only rows with data Shaz Excel Discussion (Misc queries) 2 February 16th 06 04:32 AM
deleting hidden rows so i can print only the rows showing?????? jenn Excel Worksheet Functions 0 October 6th 05 04:05 PM
Showing Duplicate Rows EaglesNest Excel Discussion (Misc queries) 4 March 26th 05 05:21 PM
Macro showing just certain rows sebastienm Excel Programming 0 August 10th 04 05:47 PM


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"