I'm getting the error:
Debug says it relates to the following line:
Not sure why?
Debug says it relates to the following line:
VBA Code:
Range("21:34").EntireRow.Hidden = True
Not sure why?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox "The range that changed was" & vbLf & Target.Address(0, 0) 'for test purposes only
Select Case Target.Address(0, 0)
Case "G16"
ActiveSheet.Shapes("CheckBox6").Visible = (Len(Target.Value) > 0)
Case "C10"
'Application.EnableEvents = False
Sheets("Instalments").Unprotect
If Target.Value = "No Payments" Then
Range("F:F").EntireColumn.Hidden = True
ElseIf Target.Value = "Credit on Account" Then
Range("F:F").EntireColumn.Hidden = False
ElseIf Target.Value = "Debit on Account" Then
Range("F:F").EntireColumn.Hidden = False
End If
Case "C20"
If Target.Value = "No Discount" Then
Range("21:34").EntireRow.Hidden = True
Range("C20").Select
ElseIf Target.Value = "25% Discount" Then
Range("21:24").EntireRow.Hidden = False
Range("25:34").EntireRow.Hidden = True
ElseIf Target.Value = "50% Discount" Then
Range("26:29").EntireRow.Hidden = False
Range("21:25").EntireRow.Hidden = True
Range("30:34").EntireRow.Hidden = True
ElseIf Target.Value = "50% Discount & 25% Discount" Then
Range("31:34").EntireRow.Hidden = False
Range("21:30").EntireRow.Hidden = True
End If
Sheets("Instalments").Protect
Range("C20").Select
End Select
End Sub