cmschmitz24
Board Regular
- Joined
- Jan 27, 2017
- Messages
- 150
Can someone help me with combining the following two macros?
I cannot seem to figure out what I need to change/update.
I cannot seem to figure out what I need to change/update.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address <> "$B$3" Then Exit Sub
Application.EnableEvents = False
If Target.Value = "Married" Then
'Hides Federal Single
Cells.EntireColumn.Hidden = False
Columns("H:H").Hidden = True 'Hides Federal Single - State Single
Columns("J:J").Hidden = True 'Hides Federal Single - State Married
Columns("I:I").Hidden = False 'Unhides Federal Married - State Married
Columns("K:K").Hidden = False 'Unhides Federal Married - State Single
End If
If Target.Value = "Single" Then
'Hides Federal Married
Cells.EntireColumn.Hidden = False
Columns("H:H").Hidden = False 'Unhides Federal Single - State Single
Columns("J:J").Hidden = False 'Unhides Federal Single - State Married
Columns("I:I").Hidden = True 'Hides Federal Married - State Married
Columns("K:K").Hidden = True 'Hides Federal Married - State Single
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change2(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address <> "$B$4" Then Exit Sub
Application.EnableEvents = False
If Target.Value = "Married" Then
'Hides State Single
Cells.EntireColumn.Hidden = False
Columns("H:H").Hidden = True 'Hides Federal Single - State Single
Columns("J:J").Hidden = False 'Unhides Federal Single - State Married
Columns("I:I").Hidden = False 'Unhides Federal Married - State Married
Columns("K:K").Hidden = True 'Hides Federal Married - State Single
End If
If Target.Value = "Single" Then
'Hides State Married
Cells.EntireColumn.Hidden = False
Columns("H:H").Hidden = False 'Hides Federal Single - State Single
Columns("J:J").Hidden = True 'Unhides Federal Single - State Married
Columns("I:I").Hidden = True 'Unhides Federal Married - State Married
Columns("K:K").Hidden = False 'Hides Federal Married - State Single
End If
Application.EnableEvents = True
End Sub