Supportnet / Forum / Skripte(PHP,ASP,Perl...)
aktivierte ToggleButton zählen
Frage
Hallo zusammen,
ich hab da ein Problem in VBA. Ich hab einen Frame, in dem mehrere ToggleButtons sind. Nun will ich nachdem ein "normaler" button gedrückt wird zählen, wieviel ToggleButton aktiviert sind, ohne dass ich in den Code jetzt x mal reinschreib If ToggleButtonx.value = true then anzahl = anzahl + 1 (es sind 49 buttons ..)
Hat da jemand ne Lösung?
Im voraus schonmal danke.
MfG
Daniel
Antwort 1 von kicia
Dim c As Control
Dim anzahl As Integer
anzahl = 0
For Each c In Frame1.Controls
If c.Value Then anzahl = anzahl + 1
Next
Dim anzahl As Integer
anzahl = 0
For Each c In Frame1.Controls
If c.Value Then anzahl = anzahl + 1
Next
Antwort 2 von Larrikin
Wow .. danke für die schnelle Lösung!!

