Supportnet Computer
Planet of Tech

Supportnet / Forum / Tabellenkalkulation

formel um checkboxen...





Frage

hallo @ all, suche eine formel um checkboxen mit häckchen zusammen zu zählen. danke im voraus :)

Antwort 1 von nighty

hi Schorni :)

formel wird nur nach selectierung und return aktualisiert,da mir kein rechter ereignisausloeser einfaellt :(

gruss nighty

beispiel :

=CheckboxZaehlenTrue()

Function CheckboxZaehlenTrue() As Double
Application.Volatile
Dim i As Integer
Dim ctl
i = 0
On Error Resume Next
For Each ctl In ActiveSheet.Shapes
  If ctl.OLEFormat.ProgId = "Forms.CheckBox.1" Then If ctl.OLEFormat.Object.Object Then i = i + 1
Next
On Error GoTo 0
CheckboxZaehlenTrue = CheckboxZaehlenTrue + i
End Function




Antwort 2 von nighty

hi Schorni :)

hier eine andere variante :)

gruss nighty

Private Sub CheckBox1_Click()
makro01
End Sub


Private Sub CheckBox2_Click()
makro01
End Sub


Sub makro01()
Dim i As Integer
Dim ctl
i = 0
On Error Resume Next
For Each ctl In ActiveSheet.Shapes
  If ctl.OLEFormat.ProgId = "Forms.CheckBox.1" Then If ctl.OLEFormat.Object.Object Then i = i + 1
Next
Range("A1") = i
On Error GoTo 0
End Sub


ausgabe erfolgt in diesem beispiel in zelle A1

Antwort 3 von nighty

hi Schorni :)

so koennte das auch noch gehen ,auf obige formel bezogen

A1 als ausloeser ,kann eine beliebige zelle sein die eine eingabe erwartet,nachdessen return werden alle CheckboxZaehlenTrue formeln aktualisiert

=CheckboxZaehlenTrue()+(A1-A1)

gruss nighty