ComboBox.Rowsource=Range (in an Add-In) = How?

I_AM

Board Regular
Joined
Jul 2, 2002
Messages
141
Hello,
When I use the following code refering to the stated sheets in the same workbook, all works fine. However I am trying to put together an Add-In. All the sheets in the add-in carry the same name as in the code below(In fact I copied them over with Ranges etc..re-referenced)I have tried all sorts of variations, but I either get a error trying to show the form or in the line that refers to RowSource (Initialize).

Private Sub CommandButton2_Click()
Sheets("Sold_02-03").Select
With Worksheets("Criteria_Values").Range("PrintCertsCriteria")
.Cells(2, 1).Value = ComboBox1.Value
.Cells(2, 2).Value = ComboBox2.Value
End With
Worksheets("Sold_02-03").Range("Database").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange _
:=Worksheets("Criteria_Values").Range("PrintCertsCriteria"), Unique:=False
End Sub

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "Criteria_Values! c6:c9"
ComboBox2.RowSource = "Criteria_Values!d6:d17"
End Sub
(to repeat, above works fine when all sheets are in same workbook)


Ie One variation that does not work. ComboBox1.RowSource = Workbooks("RvP.xla").Sheets(3).Range("C6:C9").Value
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,215,046
Messages
6,122,849
Members
449,096
Latest member
Erald

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
Back
Top