SarahClark01
New Member
- Joined
- Feb 15, 2018
- Messages
- 2
Hi there,
I am trying to adjust excel so that when certain criteria is met, additional rows are unhidden.
For example, when a number is entered, it unhides some rows (1 is entered 2 rows unhidden, 2 is entered four rows are unhidden etc). Once the rows are hidden, if a word is entered in a specific cell, another group of rows are unhidden.
Individually this code works, together it does not.
code is below:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("e3")) Is Nothing Then
ActiveSheet.Rows("4:13").EntireRow.Hidden = True
If Target = 0 Then
ActiveSheet.Rows("7:13").EntireRow.Hidden = True
ActiveSheet.Rows("4:6").EntireRow.Hidden = True
ElseIf Target = 1 Then
ActiveSheet.Rows("4:6").EntireRow.Hidden = False
ActiveSheet.Rows("7:13").EntireRow.Hidden = False
ElseIf Target = 2 Then
End If
End If
End Sub
Private Sub Worksheet_Change1(ByVal value As Range)
If Not Intersect(value, Range("E4")) Is Nothing Then
ActiveSheet.Rows("24:30").EntireRow.Hidden = True
If value = "FS" Then
ActiveSheet.Rows("24:30").EntireRow.Hidden = False
ActiveSheet.Rows("24:30").EntireRow.Hidden = False
ElseIf value = "" Then
End If
End If
End Sub
what am I doing wrong?
Sarah
I am trying to adjust excel so that when certain criteria is met, additional rows are unhidden.
For example, when a number is entered, it unhides some rows (1 is entered 2 rows unhidden, 2 is entered four rows are unhidden etc). Once the rows are hidden, if a word is entered in a specific cell, another group of rows are unhidden.
Individually this code works, together it does not.
code is below:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("e3")) Is Nothing Then
ActiveSheet.Rows("4:13").EntireRow.Hidden = True
If Target = 0 Then
ActiveSheet.Rows("7:13").EntireRow.Hidden = True
ActiveSheet.Rows("4:6").EntireRow.Hidden = True
ElseIf Target = 1 Then
ActiveSheet.Rows("4:6").EntireRow.Hidden = False
ActiveSheet.Rows("7:13").EntireRow.Hidden = False
ElseIf Target = 2 Then
End If
End If
End Sub
Private Sub Worksheet_Change1(ByVal value As Range)
If Not Intersect(value, Range("E4")) Is Nothing Then
ActiveSheet.Rows("24:30").EntireRow.Hidden = True
If value = "FS" Then
ActiveSheet.Rows("24:30").EntireRow.Hidden = False
ActiveSheet.Rows("24:30").EntireRow.Hidden = False
ElseIf value = "" Then
End If
End If
End Sub
what am I doing wrong?
Sarah