Weisst jemand warum diese Macro nicht funktionniert ?
Private Sub CommandButton1_Click()
Dim Controls As TextBox
For Each Controls In UserForm1
Controls.Clear
Next
End Sub
Vielen Dank !
Weisst jemand warum diese Macro nicht funktionniert ?
Private Sub CommandButton1_Click()
Dim Controls As TextBox
For Each Controls In UserForm1
Controls.Clear
Next
End Sub
Vielen Dank !
Doppelpostings sind sehr beliebt.
Du solltest so vorgehen. Schleife und darin:
If Controls(iControl).Name Like "Textbox*" Then
...
End If
Private Sub CommandButton1_Click()
For Each Controls In UserForm1
If Controls(IControl).Name Like "Textbox*" Then
Controls(IControl).Text = ""
End If
Next
End Sub
entweder:
For Each Control in Controls
If Control.Name Like ...
Next
oder:
For iControl = 0 To Controls.Count - 1
If Controls(iControl).Name Like ...
Next
Versuch's mal so ...
Option Explicit
Code eingefügt mit Syntaxhighlighter 1.13
Private Sub CommandButton1_Click()
Dim i As Object
For Each i In UserForm1.Controls
If TypeOf i Is MSForms.TextBox Then
i.Text = vbNullString
End If
Next i
End Sub
Weitere Beispiele findest Du auf meiner Homepage.
Gruß
Thomas
------------------------------
Internet: Homepage
eMail: Thomas.Risi@t-online.de
------------------------------
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen