AW: Inhalt aller Steuerelemente löschen
05.06.2005 18:03:19
Hajo_Zi
Hallo Swen,
bei VBA Gut dürfte es kein Problem sein den Code anzupassen.
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
Bitte keine Mail, Probleme sollten im Forum gelöst werden.
Microsoft MVP für Excel
Das Forum lebt auch von den Rückmeldungen.
Betriebssystem XP Home SP2 und Excel Version 2003 SP1.