#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default Rows won't hide

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




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Rows won't hide

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").Entir eRow.Hidden = True
End If
End Sub

Mike

"Marilyn" wrote:

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




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default Rows won't hide

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

"Marilyn" wrote:

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




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Rows won't hide

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

"Marilyn" wrote:

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

"Marilyn" wrote:

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




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
Hide Rows Mawaller Excel Discussion (Misc queries) 4 August 23rd 07 04:49 PM
cut rows without cutting hide rows מיכל Excel Discussion (Misc queries) 1 June 25th 07 02:01 PM
hide rows if Greyson Excel Discussion (Misc queries) 0 November 3rd 06 09:35 PM
Hide the rows shail Excel Worksheet Functions 0 September 28th 06 05:00 PM
Hide Rows - copy and paste only rows that show Access101 Excel Worksheet Functions 3 March 1st 06 12:39 AM


All times are GMT +1. The time now is 02:05 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"