I have 2 Combo box's sitting side by side, based off the list I need rows hidden and shown, so that the proper questions are shown. This is repeated down the sheet.
This is the code I was using when I was using Data Validation, however since I need the arrow on the right hand side to always show I switched to Combo box's.
Any help would be greatly appreciated.
Thank you in advance for any help.
Ok here is the code for what I currently have but Combox.1 cancels out Combobox.2 I cannot figure out how to put these two together.
I have asked this question on another site as well as I really need answers.
Hide Rows based of items from a ComboBox List.
This is the code I was using when I was using Data Validation, however since I need the arrow on the right hand side to always show I switched to Combo box's.
Any help would be greatly appreciated.
Thank you in advance for any help.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range, x As Long, y As Long
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
If Not Application.Intersect(Target, Range("B20,E20,B27,E27,B34,E34,B41,E41,B48,E48")) Is Nothing Then
x = Target.Offset(1).Row: y = Target.Offset(6).Row
For Each Cell In Range(Range("B" & x), Range("B" & y))
Cell.EntireRow.Hidden = (Left(Range("B" & Cell.Row), 1) = " " And Left(Range("E" & Cell.Row), 1) = " ")
Next
End If
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
If Not Application.Intersect(Target, Range("B62,E62,B66,E66,B69,E69,B70,E70,B74,E74")) Is Nothing Then
x = Target.Offset(1).Row: y = Target.Offset(3).Row
For Each Cell In Range(Range("B" & x), Range("B" & y))
Cell.EntireRow.Hidden = (Left(Range("B" & Cell.Row), 1) = " " And Left(Range("E" & Cell.Row), 1) = " ")
Next
End If
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
Ok here is the code for what I currently have but Combox.1 cancels out Combobox.2 I cannot figure out how to put these two together.
Code:
Private Sub ComboBox1_Change()
If ComboBox1.Value = "Awning" Then
ActiveSheet.Range("21:25").EntireRow.Hidden = False
ElseIf ComboBox1.Value = "Parallelagrams" Then
ActiveSheet.Range("21:22").EntireRow.Hidden = False
ActiveSheet.Range("23:25").EntireRow.Hidden = True
ElseIf ComboBox1.Value = "Marketing_Case" Then
ActiveSheet.Range("21:22").EntireRow.Hidden = False
ActiveSheet.Range("23:25").EntireRow.Hidden = True
ElseIf ComboBox1.Value = "New_Item" Then
ActiveSheet.Range("21:25").EntireRow.Hidden = True
End If
End Sub
Private Sub ComboBox2_Change()
If ComboBox2.Value = "Awning" Then
ActiveSheet.Range("21:25").EntireRow.Hidden = False
ElseIf ComboBox2.Value = "Parallelagrams" Then
ActiveSheet.Range("21:22").EntireRow.Hidden = False
ActiveSheet.Range("23:25").EntireRow.Hidden = True
ElseIf ComboBox2.Value = "Marketing_Case" Then
ActiveSheet.Range("21:22").EntireRow.Hidden = False
ActiveSheet.Range("23:25").EntireRow.Hidden = True
ElseIf ComboBox2.Value = "New_Item" Then
ActiveSheet.Range("21:25").EntireRow.Hidden = True
End If
End Sub
I have asked this question on another site as well as I really need answers.
Hide Rows based of items from a ComboBox List.
Last edited: