If Range("C31").Value = 0 AND Range("C32").Value = 0Then
Rows("30:35").EntireRow.Hi
Else
Rows("30:35").EntireRow.Hi
End If
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("$A$12:$A$1500")) Then
If Range("C24").Value = 0 Then
Rows("24:27").EntireRow.Hidden = True
Else
Rows("24:27").EntireRow.Hidden = False
End If
If Range("C23").Value = 0 Then
Rows("23").EntireRow.Hidden = True
Else
Rows("23").EntireRow.Hidden = False
End If
If Range("C32").Value = 0 Then
Rows("32:35").EntireRow.Hidden = True
Else
Rows("32:35").EntireRow.Hidden = False
End If
If Range("C31").Value = 0 Then
Rows("31").EntireRow.Hidden = True
Else
Rows("31").EntireRow.Hidden = False
End If
[b] If Range("C31, C32").Value = 0 Then
Rows("30:35").EntireRow.Hidden = True
Else
Rows("30:35").EntireRow.Hidden = False
End If[/b]
End If
End Sub
If Range("C31, C32").Value = 0 Then
Rows("30:35").EntireRow.Hidden = True
Else
Rows("30:35").EntireRow.Hidden = False
End If
If Range("C31").Value = 0 and Range("C32").Value = 0 Then
Rows("30:35").EntireRow.Hidden = True
Else
Rows("30:35").EntireRow.Hidden = False
End If
If Range("C32").Value = 0 Then
Rows("32:35").EntireRow.Hidden = True
Else
Rows("32:35").EntireRow.Hidden = False
End If
If Range("C31").Value = 0 Then
Rows("31").EntireRow.Hidden = True
Else
Rows("31").EntireRow.Hidden = False
End If
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("$A$12:$A$1500")) Then
Rows("24:27").EntireRow.Hidden = Range("C24").Value = 0
Rows("23").EntireRow.Hidden = Range("C23").Value = 0
Rows("32:35").EntireRow.Hidden = Range("C32").Value = 0
Rows("31").EntireRow.Hidden = Range("C31").Value = 0
Rows("30:35").EntireRow.Hidden = Range("C31").Value2 = 0 And Range("C32").Value2 = 0
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("$A$12:$A$1500")) Then
If Range("C24").Value = 0 Then
Rows("24:27").EntireRow.Hidden = True
Else
Rows("24:27").EntireRow.Hidden = False
End If
If Range("C23").Value = 0 Then
Rows("23").EntireRow.Hidden = True
Else
Rows("23").EntireRow.Hidden = False
End If
'checking for c32 = 0 here
If Range("C32").Value = 0 Then
Rows("32:35").EntireRow.Hidden = True
Else
Rows("32:35").EntireRow.Hidden = False
End If
'checking for c31 = 0 here
If Range("C31").Value = 0 Then
Rows("31").EntireRow.Hidden = True
Else
Rows("31").EntireRow.Hidden = False
End If
'checking for c31 is 0 again and checking for c32 is 0 again. Do you need the prior to if statements?
If Range("C31").Value = 0 and Range("C32").Value = 0 Then
Rows("30:35").EntireRow.Hidden = True
Else
Rows("30:35").EntireRow.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("$A$12:$A$1500")) Is Nothing Then
Rows("24:27").EntireRow.Hidden = Range("C24").Value = 0
Rows("23").EntireRow.Hidden = Range("C23").Value = 0
Rows("32:35").EntireRow.Hidden = Range("C32").Value = 0
Rows("31").EntireRow.Hidden = Range("C31").Value = 0
Rows("30:35").EntireRow.Hidden = Range("C31").Value2 = 0 And Range("C32").Value2 = 0
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("$A$12:$A$1500")) Then
If Range("C24").Value = 0 Then
Rows("24:27").EntireRow.Hidden = True
Else
Rows("24:27").EntireRow.Hidden = False
End If
If Range("C23").Value = 0 Then
Rows("23").EntireRow.Hidden = True
Else
Rows("23").EntireRow.Hidden = False
End If
If Range("C31").Value = 0 and Range("C32").Value = 0 Then
'both ranges are zero, hide rows 30-35
Rows("30:35").EntireRow.Hidden = True
Elseif Range("C32").Value > 0 then
'range > 0, display rows 32-35
Rows("32:35").EntireRow.Hidden = False
'hide row 31
Rows("31").EntireRow.Hidden = true
elseif range("c31").value > 0 then
'range > 0, display row 31
Rows("31").EntireRow.Hidden = False
'hide rows 32-35
Rows("32:35").EntireRow.Hidden = true
else
'display rows 30-35
Rows("30:35").EntireRow.Hidden = False
End If
End If
End Sub
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!