Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
dummster
 
Posts: n/a
Default hide rows based on cell value

I'm new to Excel and VBA. I try to hide rows based on whether the user enters
a specific word(s)/phrase into a specific cell. For example, if cell M49 has
a value of "i love lucy", then unhide rows 50 through 55, if cell M49 is
empty or has any other value than "i love lucy", then hide the rows. How do I
implement that?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Trevor Shuttleworth
 
Posts: n/a
Default hide rows based on cell value

' Sheet 1 Class Module
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("M49")) Is Nothing Then Exit Sub
If LCase(Range("M49").Value) = "i love lucy" Then
Range("A50:A55").EntireRow.Hidden = False
Else
Range("A50:A55").EntireRow.Hidden = True
End If
End Sub

Regards

Trevor


"dummster" wrote in message
...
I'm new to Excel and VBA. I try to hide rows based on whether the user
enters
a specific word(s)/phrase into a specific cell. For example, if cell M49
has
a value of "i love lucy", then unhide rows 50 through 55, if cell M49 is
empty or has any other value than "i love lucy", then hide the rows. How
do I
implement that?



Reply
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
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 08:11 PM
Moving rows from one sheet to another based on a particular cell v mm Excel Discussion (Misc queries) 0 November 11th 05 07:29 PM
Hide/Delete entire rows based in the content of one cell Clueless Excel Discussion (Misc queries) 2 October 3rd 05 02:40 PM
macro to hide rows if cell is blank Shooter Excel Worksheet Functions 3 September 28th 05 10:55 PM
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM


All times are GMT +1. The time now is 02:48 PM.

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

About Us

"It's about Microsoft Excel"