Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code which disables CommandButton1 if correct
selections have not been made in all 6 comboboxes: If Me.ComboBox1.MatchFound = False Then Me.CommandButton1.Enabled = False If Me.ComboBox2.MatchFound = False Then Me.CommandButton1.Enabled = False If Me.ComboBox3.MatchFound = False Then Me.CommandButton1.Enabled = False If Me.ComboBox4.MatchFound = False Then Me.CommandButton1.Enabled = False If Me.ComboBox5.MatchFound = False Then Me.CommandButton1.Enabled = False If Me.ComboBox6.MatchFound = False Then Me.CommandButton1.Enabled = False It works fine but I was wondering if it was possible to loop through each ComboBox withouthaving to repeat the line. I'm looking for something like "for each ComboBox in UserForm1 if MatchFound=False then disable CommandButton1" but I don't know where to begin with it. -- Ian -- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
shortening code by defining variables using an array? | Excel Programming | |||
Multiple Criteria - Shortening Code | Excel Programming | |||
Shortening a Macro | Excel Programming | |||
shortening a forumula | Excel Discussion (Misc queries) | |||
Help with shortening/cleaning some code please | Excel Programming |