Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / March 2008

Tip: Looking for answers? Try searching our database.

Rows won't hide

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marilyn - 23 Mar 2008 11:07 GMT
Hello     my code is
Private Sub Worksheet_Change(ByVal Target As Range)
   If (Range("F365") = "No") Then
        myArr = Array("12", "15", "17","33","45","89")
 EntireRow.Hidden = True
 End If
End Sub
and it does not work.....
This is what I want to do
If F365 = "No" then hide rows 12,15,17,33,45,89
the range is a1:X360
thanks for your help
Mike H - 23 Mar 2008 11:37 GMT
Marilyn,

Maybe this

Private Sub Worksheet_Change(ByVal Target As Range)
If (Range("F365") = "No") Then
   Range("12:12,15:15,17:17,33:33,45:45,89:89").EntireRow.Hidden = True
End If
End Sub

Mike

> Hello     my code is
> Private Sub Worksheet_Change(ByVal Target As Range)
[quoted text clipped - 8 lines]
> the range is a1:X360
> thanks for your help
Marilyn - 23 Mar 2008 12:10 GMT
Thanks Mike
My Fault .. the formula works fine but let me clarify.
1.  if cell "F365"  is blank or says "Yes" I do not want to hide the rows.
However
2.  Cell F365 has the following formula  =Sheet2!D1, which is a data
validation list (3 lines) blank, Yes, No
and when I select No , and cell F365 shows "NO" this formula does not work .
THe above formula works if I just type the word NO in cell F365
Again thanks in advance

> Hello     my code is
> Private Sub Worksheet_Change(ByVal Target As Range)
[quoted text clipped - 8 lines]
> the range is a1:X360
> thanks for your help
Mike H - 23 Mar 2008 12:39 GMT
Marilyn,

The way to do it is use shhet 2 sheet change code and when d1 chanhes there
you don't need to bother looking ay F365 on sheet one because you know it's
the same as d1 so try this

Private Sub Worksheet_Change(ByVal Target As Range)
'This is now sheet 2 sheet change code
If (Range("D1") = "No") Then
   
Sheets("Sheet1").Range("12:12,15:15,17:17,33:33,45:45,89:89").EntireRow.Hidden = True
Else
   
Sheets("Sheet1").Range("12:12,15:15,17:17,33:33,45:45,89:89").EntireRow.Hidden = False
End If
End Sub

Mike

> Thanks Mike
> My Fault .. the formula works fine but let me clarify.
[quoted text clipped - 18 lines]
> > the range is a1:X360
> > thanks for your help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.