Excel VBA - Create Reset Button on UserForm

preview_player
Показать описание
How to create a reset button on UserForm? Reset all objects (TextBox, ComboBox, OptionButton and CheckBox) with just ONE click.
-----------------------------------------------------------------------------------------------------------

Code:
For i = 1 To 3
Me.Controls("TextBox" & i).Value = ""
Next i
Me.ComboBox1.Clear
Me.ComboBox1.Value = ""
For i = 1 To 2
Me.Controls("OptionButton" & i).Value = False
Me.Controls("CheckBox" & i).Value = False
Next i
-----------------------------------------------------------------------------------------------------------

*Remarks:
1. When OptionButton and CheckBox are "checked" their values are "True"
2. When OptionButton and CheckBox are "unchecked" their values are "False"
Рекомендации по теме
Комментарии
Автор

Hope you like it. Thanks for watching and have a nice day.

ahsingtv
Автор

so refreshing, watching a tutorial in singlish. yay

gregfrllo
Автор

thank you so much this is working 100%

maneeshawijawardana
Автор

What if the txt box programming doesnt work mine doesnt work and yet i copied it word for word except for the number of txt boxes but it says that second row with the me.control doesnt work.

sunyeeyoon