View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Unable to get the dropdowns property of the worksheet class???

Private Sub commandButton1_click()
Dim i As Long, rng As Range
Dim d As DropDown, d1 As DropDown
Dim j As Long, v As Variant
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 = ""
Next
ReDim v(1 To 54)
i = 0
For Each cell In rng.Resize(18, 3)
i = i + 1
v(i) = cell.Value
Next
For i = 1 To 54
Set d = Worksheets("UserData").DropDowns("Drop Down " & i)
d.List = v
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)
End With
End Sub

--
Regards,
Tom Ogilvy

"Simon Lloyd"
wrote in message
...

Yes Tom, I want all 54 items to be in the range named by the text in
textbox2, they do need to be put in to the three columns as you have
already managed.....the placing was perfect, it was just the values
that it loaded and the range naming that didnt work as i imagined, but
i agree that it was my ineptitude at explaining that caused this.

Any further help you feel you could impart would be greatly
appreciated

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