Loop help
I’m running a FOR EACH NEXT loop that examines the controls in my command bar but it fails with a type mismatch because the last one examined has been disabled and I am having difficulty thinking how I can get out of this.
Here is the code.
For Each ctl In CommandBars("Filter Toolbar").Controls
If ctl.Text <> "" And ctl.Type = msoControlComboBox Then
i = i + 1
End If
Next
I’m running a FOR EACH NEXT loop that examines the controls in my command bar but it fails with a type mismatch because the last one examined has been disabled and I am having difficulty thinking how I can get out of this.
Here is the code.
For Each ctl In CommandBars("Filter Toolbar").Controls
If ctl.Text <> "" And ctl.Type = msoControlComboBox Then
i = i + 1
End If
Next