Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Pascal Engelmajer
Salut, Dim ctrl As Control Dim nom As String For Each ctrl In Me.Controls nom = ctrl.Name If InStr(nom, "TextBox") Then 'ou tout autre test particulier ctrl.Value = "" ElseIf InStr(nom, "CheckBox") Then 'ou tout autre test particulier ctrl.Value = False ElseIf InStr(nom, "ComboBox") Then 'ou tout autre test particulier Debug.Print ctrl.ListIndex ctrl.ListIndex = -1 'etc End If Next ctrl -- Amicalement. Pascal "il n'y a pas de vent favorable pour celui qui ne sait pas ou il va." Sénèque. http://www.ilyapa.net/excel http://www.ilyapa.net/baseExcel "boblebob" a écrit dans le message de news:
bjr,
dans un userform j'ai plein de contrôle Combobox, Textbox... voici la méthode que j'utilise pour les réinitialiser
With UserForm1 .TbNom.Value = "" .TbAdu.Value = "" .TbEnf.Value = "" .CboConnu = "" ... end with
N'y a-t-il pas plus rapide ?
merci --
a+
(enlever nosp-00-)
Salut,
Dim ctrl As Control
Dim nom As String
For Each ctrl In Me.Controls
nom = ctrl.Name
If InStr(nom, "TextBox") Then 'ou tout autre test particulier
ctrl.Value = ""
ElseIf InStr(nom, "CheckBox") Then 'ou tout autre test particulier
ctrl.Value = False
ElseIf InStr(nom, "ComboBox") Then 'ou tout autre test particulier
Debug.Print ctrl.ListIndex
ctrl.ListIndex = -1
'etc
End If
Next ctrl
--
Amicalement.
Pascal
"il n'y a pas de vent favorable pour celui qui ne sait pas ou il va."
Sénèque.
http://www.ilyapa.net/excel
http://www.ilyapa.net/baseExcel
"boblebob" <nosp-00-boblebob@voila.fr> a écrit dans le message de news:
uErgNdTTEHA.3512@TK2MSFTNGP12.phx.gbl...
bjr,
dans un userform j'ai plein de contrôle Combobox, Textbox...
voici la méthode que j'utilise pour les réinitialiser
With UserForm1
.TbNom.Value = ""
.TbAdu.Value = ""
.TbEnf.Value = ""
.CboConnu = ""
...
end with
Salut, Dim ctrl As Control Dim nom As String For Each ctrl In Me.Controls nom = ctrl.Name If InStr(nom, "TextBox") Then 'ou tout autre test particulier ctrl.Value = "" ElseIf InStr(nom, "CheckBox") Then 'ou tout autre test particulier ctrl.Value = False ElseIf InStr(nom, "ComboBox") Then 'ou tout autre test particulier Debug.Print ctrl.ListIndex ctrl.ListIndex = -1 'etc End If Next ctrl -- Amicalement. Pascal "il n'y a pas de vent favorable pour celui qui ne sait pas ou il va." Sénèque. http://www.ilyapa.net/excel http://www.ilyapa.net/baseExcel "boblebob" a écrit dans le message de news:
bjr,
dans un userform j'ai plein de contrôle Combobox, Textbox... voici la méthode que j'utilise pour les réinitialiser
With UserForm1 .TbNom.Value = "" .TbAdu.Value = "" .TbEnf.Value = "" .CboConnu = "" ... end with