cmutschler
New Member
- Joined
- Feb 3, 2016
- Messages
- 5
Hi!
I'm new to VBA and need some help changing this to a case statement. Thank you for your help!!! Cheryl
If ActiveSheet.Shapes("Check Box 110").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("C").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("C").EntireColumn.Hidden = True
End If
If ActiveSheet.Shapes("Check Box 111").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("D").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("D").EntireColumn.Hidden = True
End If
If ActiveSheet.Shapes("Check Box 122").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("E").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("E").EntireColumn.Hidden = True
End If
If ActiveSheet.Shapes("Check Box 123").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("F").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("F").EntireColumn.Hidden = True
End If
..... a bazillion more checkboxes
I'm new to VBA and need some help changing this to a case statement. Thank you for your help!!! Cheryl
If ActiveSheet.Shapes("Check Box 110").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("C").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("C").EntireColumn.Hidden = True
End If
If ActiveSheet.Shapes("Check Box 111").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("D").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("D").EntireColumn.Hidden = True
End If
If ActiveSheet.Shapes("Check Box 122").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("E").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("E").EntireColumn.Hidden = True
End If
If ActiveSheet.Shapes("Check Box 123").ControlFormat.Value = 1 Then
Sheets("DHMO Copay").Columns("F").EntireColumn.Hidden = False
Else: Sheets("DHMO Copay").Columns("F").EntireColumn.Hidden = True
End If
..... a bazillion more checkboxes