Hallo Leute,
Ich habe ein Problem mit CheckBoxen,wenn ich auf CommandButton (Select all Checkboxen) drücke,wurde das Makro problemlos ausgeführt.und wurde alle Checkboxen selektiert.aber ohne effekt auf Checkboxen.
Ich wäre Ihnen sehr Dankbar,wenn Sie mir hilfen können.
Hier ist den Code:
Option Explicit
Public Sub CheckBox_Click1()
With ActiveSheet
.Range("AC:AC,AX:AX,BS:BS,CN:CN").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click2()
With ActiveSheet
.Range("AD:AD,AY:AY,BT:BT,CO:CO").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click3()
With ActiveSheet
.Range("AE:AE,AZ:AZ,BU:BU,CP:CP").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click4()
With ActiveSheet
.Range("AF:AF,BA:BA,BV:BV,CQ:CQ").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click5()
With ActiveSheet
.Range("AG:AG,BB:BB,BW:BW,CR:CR").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click6()
With ActiveSheet
.Range("AH:AH,BC:BC,BX:BX,CS:CS").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click7()
With ActiveSheet
.Range("AI:AI,BD:BD,BY:BY,CT:CT").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click8()
With ActiveSheet
.Range("AJ:AJ,BE:BE,BZ:BZ,CU:CU").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click9()
With ActiveSheet
.Range("AK:AK,BF:BF,CA:CA,CV:CV").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click10()
With ActiveSheet
.Range("AL:AL,BG:BG,CB:CB,CW:CW").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click11()
With ActiveSheet
.Range("AM:AM,BH:BH,CC:CC,CX:CX").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click12()
With ActiveSheet
.Range("AN:AN,BI:BI,CD:CD,CY:CY").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click13()
With ActiveSheet
.Range("AO:AO,BJ:BJ,CE:CE,CZ:CZ").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click14()
With ActiveSheet
.Range("AP:AP,BK:BK,CF:CF,DA:DA").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click15()
With ActiveSheet
.Range("AQ:AQ,BL:BL,CG:CG,DB:DB").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click16()
With ActiveSheet
.Range("AR:AR,BM:BM,CH:CH,DC:DC").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click17()
With ActiveSheet
.Range("AS:AS,BN:BN,CI:CI,DD:DD").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click18()
With ActiveSheet
.Range("AT:AT,BO:BO,CJ:CJ,DE:DE").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click19()
With ActiveSheet
.Range("AU:AU,BP:BP,CK:CK,DF:DF").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
Public Sub CheckBox_Click20()
With ActiveSheet
.Range("AV:AV,BQ:BQ,CL:CL,DG:DG").EntireColumn.Hidden = (.CheckBoxes(Application.Caller).Value <> xlOn)
End With
End Sub
und Hier den Code für Select und Deselect all Checkboxes:
Sub Select_all_Checkboxen()
ActiveSheet.CheckBoxes = True
End Sub
Sub Deselect_all_Checkboxen()
ActiveSheet.CheckBoxes = False
End Sub
VG
|