![]() |
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? |
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? |
All times are GMT +1. The time now is 07:47 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com