Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Loop trough comboboxes

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Loop trough comboboxes

I believe the short answer to that is yes.

Regards,
Steve

Lasse wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Loop trough comboboxes

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)


"Lasse" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling comboboxes in loop - problem Sławcio.xww Excel Programming 2 August 29th 06 09:07 AM
keyboard shortcut to browse trough sheets Denis Chabot Excel Discussion (Misc queries) 4 July 25th 06 02:16 PM
loop trough e-mail address list to send task lists with outlook Paul. Excel Discussion (Misc queries) 2 April 14th 05 11:48 AM
Net Send command trough VBA Michael Rhein Excel Programming 1 July 2nd 04 03:11 AM
How much data could be entered and search trough Michel[_3_] Excel Programming 1 September 10th 03 07:52 AM


All times are GMT +1. The time now is 07:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"