Re: Auflistung von Steuerelementen
  Home FAQ Contact Sign in
microsoft.public.de.excel only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Auflistung von Steuerelementen         

Group: microsoft.public.de.excel · Group Profile
Author: HelmutMit
Date: May 10, 2008 14:09

On 10 Mai, 18:59, Hajo_Zi discussions.microsoft.com> wrote:
> Hallo Helmut,
>
> Private Sub CMD_Liste1_Click()
> ' auflisten aller Steuerelemente in der UserForm, getrennt nach Typen
> Dim ObCb As Object
> 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 Auftrag.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
> End Sub
>
> Gruß Hajo
> MVP für Microsoft Excel
> Betriebssystem Vista Ultimate und Excel Version2007http://Hajo-Excel.de/
>
> "HelmutMit" wrote:
>> Hallo zusammen,
>> wer kann mir sagen, wie ich die Namen der Steuerelemente einer
>> Userform in einer Excel-Tabelle auflisten kann (bitte mit Deklaration
>> der Objekt-Variablen)?
>
>> Gruß Helmut

Hallo Hajo,
danke für Deine ausführliche Antwort. Leider steigt die Prozedur mit
Fehler aus bei der Codezeile 'For Each ObCb In Auftrag.Controls'.
Ich verstehs auch nicht: Auftrag.Controls? Was ist denn das: Auftrag?
Gruß Helmut
no comments
diggit! del.icio.us! reddit!