You are here: HomeExcelTutorials
Facebook Twitter Reddit More...

VBA to loop through Comboboxes in active worksheet

VBA to loop through Comboboxes in active worksheet

Price: FREE

I am trying to loop through each combobox in the active worksheet to set the value in them to blank, but I am getting error message while executing the third line, stating Runtime error 438 - Object does not support this property or method. Can some one tell me where my code is wrong?
1 Sub clear all()
2 Dim combo As ComboBox
3 For Each combo In ActiveWorkbook.ActiveSheet
4 combo.Text = ""

Visit publisher's web-site: VBA to loop through Comboboxes in active worksheet

Category and Tags: ExcelTutorials :

Related Tutorials

Excel VBA Multiple Combobox AddItem Loop

Free: Yes
Tags: Excel › VBA

I have 4 comboboxes, combobox1, combobox2, etc and would like to create a loop/for to run through and add all the same items to these comboboxes.
I don't think the following will work:
Dim I as integer
with combobox & I
For I = 1 to 4
.additem "Test1"
.additem "Test2"
Next I
end with
How can I make this work, I assume there is some setting of objects or something I need to do here.

Loop through boxes

Free: Yes
Tags: Excel › VBA

I've got an Excel sheet with 10 checkboxes. On Checkbox_change, they all have to run the same code, ie enabling and changing the background colour of several corresponding comboboxes. The only difference is the number of the box: Checkbox1 has to change Combobox1 and Combobox11, Checkbox2 Combobox2 and Combobox12 and so on. The easiest would be to pass a number (Box number, 1 or 2 in this case) to a general code that changes the corresponding Comboboxes. However, Activesheet.ComboBox& Boxnumber.Enabled = true is not a valid piece of code. Anyone?

Return name of active Combobox?

Free: Yes
Tags: Excel › VBA

How can I return the name of the currently selected combobox after a Click event?
I have 10 comboboxes embedded in a worksheet and want the same procedure to run on anyone that is selected. I'm looking for something like the ActiveSheet property. Then I can set and use a single variable name for the current object in my

Combobox number format issue

Free: Yes
Tags: Excel › VBA

Is there a way to format numbers as fractions for comboboxes?
I got two Comboboxes - 1 in a userform and 1 in a worksheet.
The selection (range) they display often contain values with fractions - e.g. 8 1/2.
Both comboboxes display 8.5 - I'm guessing there is a lengthy workaround to use text (and that it exists number formatting that I've been unable to find).

Linked comboboxes in a excel checklist

Free: Yes
Tags: Excel › VBA

to solve the following problem.
I have done a checklist in a worksheet.
In this checklist the user should use some comboboxes to select for example the brand of some items.
Once the brand is selected I would like to show a second combo box listing only the models of that brand.
I can't do that with a userform (because end users don't like) so the lesson linked comboboxes can't solve my question.
I've already tried to adapt this lesson to my problem but I don't manage. I've used usual combobox and Activex combobox but it doesn't work.
Thanks, best wishes,

Related Applications & Scripts

Dance Loop

Free: No
Tags: Flash › Excel Animated Cartoons

A timeline animated dance loop in the style of the 80s

Star background loop optical

Free: No
Tags: Flash › Excel Animations

Star background loop optical for banner, animation, everything. Enjoy the optical side 2!

CORNER SMOKE LOOP

Free: No
Tags: Flash › Excel Animations

An animated smoke effect that loops. Just what a project needs a cloud effect to give a project more hot air.

FIRE LOOP Animation

Free: No
Tags: Flash › Excel Animations

A traditional animation of fire and flames. This ani is the sort that would be found in a fireplace of in the foreground of an inferno. This combustible little looping animation is 8kb after publishing and beware its hot, HOT , HOT!!!

Diamond loop clip AS2

Free: No
Tags: Flash › Excel Animations

This is a diamond movieClip animation. Simply drag the main movieClip (diamondMain_mc) into your movie.
- 100% vector
- Optimized to high performance (small use of memory)
- 24fps

© 2014 Contact us - Privacy Policy - Terms of use - Add Listing