Auto Increment Combobox Number

StevenD

Active Member
Joined
Nov 17, 2004
Messages
262
Hi,

I want to auto increment a combobox number on a worksheet.

I found the following code in a topic but it doesn't work, maybe because it wants the combobox to be on a userform.

Code:
For i = 1 To num 
mycb = "ComboBox" & i 
Me.Controls(mycb).additem "TEST"
Next i

It comes up with this error : -

"Compile error : Method or data member not found" and highlights the .Controls bit.

Any ideas?
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
you are correct about the code.
Don't know what you mean by "combobox number"
 

Watch MrExcel Video

Forum statistics

Threads
1,118,760
Messages
5,574,088
Members
412,567
Latest member
mm1
Top