I think the main problem is I didn't have a space after the Down. So
"Drop Down" & i
should have been
"Drop Down " & i
I have tested this code and it worked for me:
Private Sub commandButton1_click()
Dim i As Long, rng As Range
Dim d As DropDown, d1 As DropDown
Dim j As Long
Set rng = Worksheets("Stats").Cells(Rows.Count, 1).End(xlUp)(2)
j = 0
k = 0
For i = 1 To 54
Set d = Worksheets("UserData").DropDowns("Drop Down " & i)
rng.Offset(j, k).Value = d.List(d.Value)
j = j + 1
If j 17 Then
j = 0
k = k + 1
End If
d.ListFillRange = Worksheets("UserData").Range( _
Worksheets("Stats").TextBox2.Text).Address(externa l:=True)
Next
With Worksheets("Stats")
Set d = Worksheets("UserData").DropDowns("Drop Down 55")
Set d1 = Worksheets("UserData").DropDowns("Drop Down 56")
.Range("M1").Value = d.List(d.Value)
.Range("M8").Value = d1.List(d1.Value)
d.ListFillRange = Worksheets("UserData").Range( _
Worksheets("Stats").TextBox2.Text).Address(externa l:=True)
d1.ListFillRange = Worksheets("UserData").Range( _
Worksheets("Stats").TextBox2.Text).Address(externa l:=True)
End With
End Sub
--
Regards,
Tom Ogilvy
"Simon Lloyd"
wrote in message
...
Hi Tom,
Ran your code and got the message below i have checked the names of the
Drop Down boxes and they start at 102 up to 157 so i made the changes
for box 55 and 56 and in your For i = statement, but still gives the
error below
any ideas?
Runtime 1004: Unable to get the DropDowns property of the worksheet
class
Regards,
Simon
--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile:
http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=543729