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: 44
Default Hiding / unhiding rows based on change of a cell

I can't seem to get the following code to work. I want to hide / unhide a
series of rows on sheet1 based on the value in a cell in sheet2. Once I
understand how to get it to work, I want to expand it to approx. 40 cells on
sheet2 to hide / unhide groups of rows on sheet1.
Do I put the code in sheet1, sheet2 or the workbook?
Any ideas to steer me in the right direction?
Thanks


Private Sub Worksheet_Change(ByVal Target As Range)
If Range("sheet2!$I$51") = "" Then
Range("sheet1!$A$641:$A$653").EntireRow.Hidden = True
Else
Range("sheet1!$A$641:$A$653").EntireRow.Hidden = False
End If
If Range("sheet2!$I$52") = "" Then
Range("sheet1!$A$654:$A$666").EntireRow.Hidden = True
Else
Range("sheet1!$A$654:$A$666").EntireRow.Hidden = False
End If
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
hiding/unhiding rows Art Excel Worksheet Functions 1 March 16th 10 05:00 PM
unhiding and hiding rows Paul_of_Abingdon[_2_] Excel Discussion (Misc queries) 2 March 6th 08 03:22 PM
Hiding/unhiding rows Matheus Excel Discussion (Misc queries) 2 November 11th 07 11:20 PM
Hiding/unhiding columns based on user selection Bob Excel Programming 8 August 15th 07 08:56 PM
Hiding/Unhiding rows Arne Hegefors Excel Programming 2 July 21st 06 08:19 AM


All times are GMT +1. The time now is 11:31 PM.

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"