是否有可能将下面的两个代码组合起来,以便在选中复选框且D11单元格具有特定选择时,基于这两个选择隐藏列?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$11" Then
If Target.Value = "A" Or Target.Value = "C" Then
Sheets("Worksheet").Columns("BL:CH").Hidden = True
ElseIf Target.Value = "C" Then
Sheets("Worksheet").Columns("BL:BY").Hidden = False
End If
End If
End Sub
Private Sub CheckBox1_Click()
Sheets("Worksheet").Columns("BZ:CH").Hidden = Not Me.CheckBox1.Value (TO UNHIDE SPECIFIC COLUMS ONLY WHEN CHECKED)
End Sub
1条答案
按热度按时间t2a7ltrp1#
这就是我要做的谢谢