Hi all,
I have a userform with a number of comboboxes of which i have kept some as hidden.
Now i have to check whether the visible comboboxes are empty or not;
When i tried the below code, it was checking the hidden comboboxes also,
Is there a way to find the empty visible comboboxes through vba code??
I have a userform with a number of comboboxes of which i have kept some as hidden.
Now i have to check whether the visible comboboxes are empty or not;
When i tried the below code, it was checking the hidden comboboxes also,
Code:
Sub test()
Dim ctl As Control
For Each ctl In frmRC.Controls
If TypeName(ctl) = "ComboBox" Then
If ctl.Value = vbNullString And ctl.Visible Then
MsgBox "Combobox is empty" & ctl.Name
End If
End If
Next ctl
End Sub
Last edited: