Excel VBA - Auto enable or disable command button on userform

preview_player
Показать описание
How to enable or disable a command button on a UserForm when certain conditions are met? This video shows a step by step tutorial from creation of a UserForm (before 2:35) to discussion on enabling or disabling a command button (after 2:35).

Useful code:
UserForm1.Controls("TextBox" & i).Value = ""
UserForm1.CommandButton1.Enabled = True

Welcome to join 🤗
Рекомендации по теме
Комментарии
Автор

Is there a way the button to be disabled and when all fields are complete to enable it ?
No mouse hover code.
I want to create a big form with many fields is there an option to test all fields ?
Thanks.

georgematsos
Автор

Hi brother, I have follow your instruction, code is working but when I renamed all TextBox (like: TextBox1, TextBox2... etc) to txtName, txtAddress. After that code isn't working and show error: could not find the specified object. what's wrong and how to fix brother?

tengseyha
Автор

How to get" list index name" on combobox vba excel
Example: Select Country

dynamic_duo