Loop trough comboboxes

  • Thread starter Thread starter Lasse
  • Start date Start date
L

Lasse

Hi,
I have 10 comboboxes (named cbx1 to cbx10) in a worksheet. When I open the
workbook, is it possible to loop through the 10 comboboxes to set some data.

In Access it's possible with code like this:

For CB = 1 To 10
Me("cbx" & CB).Visible = True
Next CB

Is it possible to do something like that in Excel VBA?

//Lasse
 
Try something like

Dim Ctrl As MSForms.Control
For Each Ctrl In Me.Controls
If TypeOf Ctrl Is MSForms.ComboBox Then
Ctrl.Visible = True
End If
Next Ctrl


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top