Running a combobox from macro

johny

Board Regular
Joined
Jul 15, 2002
Messages
69
Im trying to add to one of my macro's
to run this combobox1dropdown but can't
figure it out. This is what im trying to run

Private Sub ComboBox1_DropButtonClick()

The sheet name is sheet24 called 2MON
This is what Ive tried to do to run this
combobox1 dropdown
Application.Run "BarScheduLLE2.xls!ComboBox1_DropButtonClick" Thanks john
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

johny

Board Regular
Joined
Jul 15, 2002
Messages
69
Hi Jim
The combobox1 is from the toolbars menu Control Toolbox choices. And I chose combobox
and used view code and pasted
this under click event
Private Sub ComboBox1_DropButtonClick()

Dim iRow As Integer
ComboBox1.Clear
For iRow = 1 To [NameTable].Rows.Count
If [NameTable].Cells(iRow, 2) <= [B6] _
And [NameTable].Cells(iRow, 3) >= [e6] Then
'add to dropdown
ComboBox1.AddItem [NameTable].Cells(iRow, 1)
End If
Next iRow
End Sub

So i need to run this dropdown in another macro automatically
 

Jim North

MrExcel MVP
Joined
Jun 20, 2002
Messages
791
johny,

I'm not clear on what you are trying to do. Are you just trying to supply the list to the combo box? If yes, why not use the ListFillRange property in the combo box?
 

Watch MrExcel Video

Forum statistics

Threads
1,130,445
Messages
5,642,194
Members
417,259
Latest member
gtacw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top