![]() |
|
|
|
#1
|
|||
|
|||
|
You probably haven't declared your variables as a Long.
This should help as a code stub to understand what you have done wrong? Option Explicit Private Sub CommandButton1_Click() Dim lComboBox As Long, lCombBoxCount As Long lCombBoxCount = Me.ComboBox1.ListCount - 1 With ActiveSheet For lComboBox = 0 To lCombBoxCount .Cells(lComboBox + 1, 1).Value = Me.ComboBox1.List(lComboBox) Next lComboBox End With End Sub Private Sub UserForm_Initialize() Dim lComboBox As Long Me.ComboBox1.Clear For lComboBox = 1 To 10 Me.ComboBox1.AddItem lComboBox Next lComboBox End Sub |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Excel Combobox List
|
VBA-User | Excel Programming | 4 | 01-07-2016 02:46 AM |
Using combobox to pass data from an Excel spread sheet to text boxes on userform
|
Stewie840 | Word VBA | 14 | 12-17-2015 10:13 PM |
How to convert a text file to an Excel file with the data format automatically?
|
mradmin | Excel | 6 | 10-16-2013 10:34 AM |
Convert lists of text in Word to excel
|
Grosspsych | Excel | 5 | 02-06-2012 08:03 PM |