#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default show hide row if

Hello Scenario - Form - when the form is opened F6 is Blank and is a
dropdown
Row 17 is not hidden
now if F6 says Distributor I want to hide Row 17 otherwise row 17 show not
be hidden
Below is my code- but it does not work
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address < "$F$6" Then Exit Sub
If .Value = "Distributor " Then
Rows(17).Hidden = True
ElseIf .Value = "Customer" Then
Rows(17).Hidden = False
ElseIf .Value = " Office" Then
Rows(17).Hidden = False
ElseIf .Value = "Demo " Then
Rows(17).Hidden = False
End If
End With


End Sub
thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default show hide row if

In your code there is a space after Distributor ("Distributor "). Remove the
space or TRIM() the value

If this post helps click Yes
---------------
Jacob Skaria


"Wanna Learn" wrote:

Hello Scenario - Form - when the form is opened F6 is Blank and is a
dropdown
Row 17 is not hidden
now if F6 says Distributor I want to hide Row 17 otherwise row 17 show not
be hidden
Below is my code- but it does not work
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address < "$F$6" Then Exit Sub
If .Value = "Distributor " Then
Rows(17).Hidden = True
ElseIf .Value = "Customer" Then
Rows(17).Hidden = False
ElseIf .Value = " Office" Then
Rows(17).Hidden = False
ElseIf .Value = "Demo " Then
Rows(17).Hidden = False
End If
End With


End Sub
thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default show hide row if

This should cover case and extraneous space problems

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address < "$F$6" Then Exit Sub
Rows(17).Hidden = False
If LCase(Application.Trim(.Value)) = "distributor" Then
Rows(17).Hidden = True
End If
End With
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Wanna Learn" wrote in message
...
Hello Scenario - Form - when the form is opened F6 is Blank and is a
dropdown
Row 17 is not hidden
now if F6 says Distributor I want to hide Row 17 otherwise row 17 show not
be hidden
Below is my code- but it does not work
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address < "$F$6" Then Exit Sub
If .Value = "Distributor " Then
Rows(17).Hidden = True
ElseIf .Value = "Customer" Then
Rows(17).Hidden = False
ElseIf .Value = " Office" Then
Rows(17).Hidden = False
ElseIf .Value = "Demo " Then
Rows(17).Hidden = False
End If
End With


End Sub
thanks in advance


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 Formula and Show Value tim m Excel Discussion (Misc queries) 0 November 29th 06 05:41 PM
Hide Formula and Show Value Gary''s Student Excel Discussion (Misc queries) 0 November 29th 06 05:41 PM
Hide Formula and Show Value Truantjlj50 Excel Discussion (Misc queries) 0 November 29th 06 05:21 PM
Hide and show Rows Duane Excel Discussion (Misc queries) 2 April 19th 05 10:50 PM
Hide/show worksheet Mal Excel Discussion (Misc queries) 5 March 29th 05 04:00 PM


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