Alle ToggleButtons in einer UserForm ansprechen

Informationen und Beispiele zu den hier genannten Dialog-Elementen:
Bild

Betrifft: Alle ToggleButtons in einer UserForm ansprechen
von: Robin
Geschrieben am: 06.05.2015 11:48:13

Hallo ihr lieben,
ist es möglich alle ToggleButtons auf einer Userform auf einmal anzusprechen? Leider sind die Buttons namentlich nicht durchnummeriert, was eine normale Zählschleife ausschließt.
Ich möchte alle gedrückten ToggleButtons auf dieser einen Userform wieder auf .Value=False setzen. Gibt es dabei einen Befehl oder doch eine Art Schleife?
Liebe Grüße,
Robin

Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:56:55
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:57:04
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:58:17
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:58:21
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW:Endschuldigung
von: Hajo_Zi
Geschrieben am: 06.05.2015 12:01:02
da ist das Forum Heute wohl langsam.
Gruß Hajo

Bild

Betrifft: AW: AW:Endschuldigung
von: Robin
Geschrieben am: 06.05.2015 12:32:26
Kein Problem, ist mir auch schon aufgefallen, war nur verwundert über die 16 neuen Infomails.
Leider erzeugt der Code beim kompilieren folgenden Fehler:
.Controls
"Fehler beim Kompilieren: Methode oder Datenobjekt nicht gefunden"

Bild

Betrifft: AW: AW:Endschuldigung
von: Hajo_Zi
Geschrieben am: 06.05.2015 12:36:12
in meiner Datei nicht, Deine sehe ich nicht.
Dim cb As Control ' Variable Steuerelemente UserForm
Gruß Hajo

Bild

Betrifft: AW: AW: Verweis
von: Hajo_Zi
Geschrieben am: 06.05.2015 12:41:32
setze ein Verweis auf MS Scripting Runtime
Gruß Hajo

Bild

Betrifft: AW: AW:Endschuldigung
von: Robin
Geschrieben am: 06.05.2015 13:07:27
Jetzt kommt zwar keine Fehlermeldung mehr, aber leider ruft dies bei mir nur die Prozedur auf, welche die UserForm öffnet, dann geschieht nichts weiter, da dein Makro erst gar nicht gestartet wird.
Ich kann leider die Datei nicht einstellen, da sensible Daten enthalten sind.

Bild

Betrifft: AW: AW:Endschuldigung
von: Hajo_Zi
Geschrieben am: 06.05.2015 13:12:48
benutze den kurzen Code von Rudi.
Gruß Hajo

Bild

Betrifft: AW: AW:Endschuldigung
von: Robin
Geschrieben am: 06.05.2015 13:22:11
Ich weiß leider nicht, was ich falsch mache, aber auch da wird nur die UserForm angezeigt und der Code läuft einfach nicht an. Ich habe den Code in die entsprechende Userform eingefügt, oder war das falsch?
Habe aber jetzt die meisten ToggleButtons schon per Excel&Ersetzen aufgelistet.
Danke, Robin

Bild

Betrifft: AW: AW:Code Rudi
von: Hajo_Zi
Geschrieben am: 06.05.2015 13:31:49
du hast schon CommandButton1 geklickt, das konnte ich nicht sehen.
Gruß Hajo

Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:58:27
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:19
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:20
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:21
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:21
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:21
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:22
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:22
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:23
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:28
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Hajo_Zi
Geschrieben am: 06.05.2015 11:59:29
Hallo Robin,

Private Sub CMD_Liste1_Click()
    '**************************************************
    '* H. Ziplies                                     *
    '* 13.01.11                                       *
    '* erstellt von HajoZiplies@WEB.de                *
'* http://Hajo-Excel.de
 *
    '**************************************************
    ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
    Dim ObCb As Object
    Application.ScreenUpdating = False
    Sheets.Add
    ActiveSheet.Name = "Steuerelemente_Typ"
    Cells(1, 1) = "Textbox"
    Cells(1, 2) = "Listbox"
    Cells(1, 3) = "Multipage"
    Cells(1, 4) = "CommandButton"
    Cells(1, 5) = "Label"
    Cells(1, 6) = "Kontrollkästchen"
    Cells(1, 7) = "OptionButton"
    Cells(1, 8) = "ToggleButton"
    Cells(1, 9) = "Frame"
    Cells(1, 10) = "ScrollBar"
    Cells(1, 11) = "ScrollBar"
    Cells(1, 12) = "Image"
    Cells(1, 13) = "ComboBox"
    Cells(1, 14) = "Rest"
    For Each ObCb In Me.Controls
        Select Case TypeName(ObCb)
            Case "TextBox"
                Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = ObCb.Name
            Case "ListBox"
                Cells(Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = ObCb.Name
            Case "MultiPage"
                Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = ObCb.Name
            Case "CommandButton"
                Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = ObCb.Name
            Case "Label"
                Cells(Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = ObCb.Name
            Case "CheckBox"
                Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = ObCb.Name
            Case "OptionButton"
                Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = ObCb.Name
            Case "ToggleButton"
                Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = ObCb.Name
            Case "Frame"
                Cells(Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = ObCb.Name
            Case "ScrollBar"
                Cells(Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = ObCb.Name
            Case "SpinButton"
                Cells(Cells(Rows.Count, 11).End(xlUp).Row + 1, 11) = ObCb.Name
            Case "Image"
                Cells(Cells(Rows.Count, 12).End(xlUp).Row + 1, 12) = ObCb.Name
            Case "ComboBox"
                Cells(Cells(Rows.Count, 13).End(xlUp).Row + 1, 13) = ObCb.Name
            Case Else
                Cells(Cells(Rows.Count, 14).End(xlUp).Row + 1, 14) = ObCb.Name
                Cells(Cells(Rows.Count, 15).End(xlUp).Row + 1, 15) = TypeName(ObCb)
        End Select
    Next ObCb
    Application.ScreenUpdating = True
End Sub


Bild

Betrifft: @hajo
von: selli
Geschrieben am: 06.05.2015 15:12:04
hallo hajo,
ist dir jemand im beitragsranking des forums auf den fersen?
(spässle)
gruß
selli

Bild

Betrifft: Da besteht wohl eher keine Gefahr, Selli! ;-) orT
von: Luc:-?
Geschrieben am: 06.05.2015 15:32:54
Allerdings hat er wohl noch „Endschulden“… ;-)
Gruß, Luc :-?

Bild

Betrifft: AW: Alle ToggleButtons in einer UserForm ansprechen
von: Rudi Maintaire
Geschrieben am: 06.05.2015 12:24:24
Hallo,
z.B.

Private Sub CommandButton1_Click()
  Dim oCtl As Control
  For Each oCtl In Controls
    If TypeName(oCtl) = "ToggleButton" Then oCtl = False
  Next
End Sub
Gruß
Rudi

 Bild

Beiträge aus den Excel-Beispielen zum Thema "Alle ToggleButtons in einer UserForm ansprechen"