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