Hello there,
I have a dropdown box with three options and if I choose the first option, columns B:H are hidden when the code specifies column F only. Can someone please tell me where I have gone wrong and how to fix it?
Thank you.
I have a dropdown box with three options and if I choose the first option, columns B:H are hidden when the code specifies column F only. Can someone please tell me where I have gone wrong and how to fix it?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = ("$C$10") Then
If Target.Value = "No Payments" Then
Application.Columns("F").Select
Application.selection.EntireColumn.Hidden = True
Range("C10").Select
ElseIf Target.Value = "Credit on Account" Then
Application.Columns("F").Select
Application.selection.EntireColumn.Hidden = False
Range("C10").Select
ElseIf Target.Value = "Debit on Account" Then
Application.Columns("F").Select
Application.selection.EntireColumn.Hidden = False
Range("C10").Select
End If
End If
End Sub