Excel 2000 VBA - Dropdowns
I'm trying to add a drop down box with the following piece of code which is virtually the same as the code on page 178.
I keep getting the error message
"Unable to get the Add property of the dropdowns class"
I am using MS Excel 2003, is the coding different for later versions of Excel ?? Or am I missing a reference that needs adding in.
Many thanks for any help given.
Sub Add_Cost_Drop_Down(Target As Range)
Dim ddBox As DropDown
Dim i As Integer
With Target
Set ddBox = Worksheets("QS Adjustments").DropDowns.Add(.Left, .Top, .Width, .Height)
End With
With ddBox
.OnAction = "Choose_Cost_Drop_Down"
For i = LBound(CCentres) To UBound(CCentres)
.AddItem CCentres(i)
Next i
End With
End Sub
|