J
JayWes
Is it possible to assign a variable range to an Embeded Control Toolbox
ComboBox? If so, how? Here's the code I've been trying to get to work.
Private Sub Workbook_Open()
Dim IMDS As Worksheet
Dim CB1 As OLEObject
Dim AllCT As Range
Dim i As Integer
Set IMDS = Workbooks("IMDS Calc.xls").Worksheets("IMDS")
Set CB1 = IMDS.OLEObjects("ComboBox1")
For i = 2 To 20
If IMDS.Range("AA" & i).Value = "" Then GoTo Line1
Next i
Line1:
Set AllCT = IMDS.Range("AA2:AA" & i - 1)
CB1.ListFillRange = AllCT
End Sub
ComboBox? If so, how? Here's the code I've been trying to get to work.
Private Sub Workbook_Open()
Dim IMDS As Worksheet
Dim CB1 As OLEObject
Dim AllCT As Range
Dim i As Integer
Set IMDS = Workbooks("IMDS Calc.xls").Worksheets("IMDS")
Set CB1 = IMDS.OLEObjects("ComboBox1")
For i = 2 To 20
If IMDS.Range("AA" & i).Value = "" Then GoTo Line1
Next i
Line1:
Set AllCT = IMDS.Range("AA2:AA" & i - 1)
CB1.ListFillRange = AllCT
End Sub