S
Simon Lloyd
Hi all, i as kindly given the code below by Tom Ogilvy but when i try to
run it i get Runtime 1004: Unable to get the dropdowns property of the
worksheet class, any ideas what is causing this?, the line in blue is
where the code stops and gives the error.
Regards,
Simon.
Sub coursetrans()
Dim i As Long, rng As Range
Dim d As DropDown, d1 As DropDown
Dim j As Long ', i As Long
Set rng = Worksheets("Collected Data").Cells(Rows.Count,
1).End(xlUp)(2)
j = 0
k = 0
For i = 102 To 155
Set d = Worksheets("User Entry").DropDowns("Drop Down" & i)
rng.Offset(j, k).Value = d.Value
j = j + 1
If j > 17 Then
j = 0
k = k + 1
d.ListFillRange = Worksheets("Collected Data").TextBox2.Text
With Worksheets("Collected Data")
d = Worksheets("User Entry").DropDowns("Drop Down 154")
d1 = Worksheets("User Entry").DropDowns("Drop Down 155")
..Range("M1").Value = d.Value
..Range("M8").Value = d1.Value
d.ListFillRange = Worksheets("User Entry").TextBox2.Text
d1.ListFillRange = Worksheets("User Entry").TextBox2.Text
End With
End If
Next
End Sub
run it i get Runtime 1004: Unable to get the dropdowns property of the
worksheet class, any ideas what is causing this?, the line in blue is
where the code stops and gives the error.
Regards,
Simon.
Sub coursetrans()
Dim i As Long, rng As Range
Dim d As DropDown, d1 As DropDown
Dim j As Long ', i As Long
Set rng = Worksheets("Collected Data").Cells(Rows.Count,
1).End(xlUp)(2)
j = 0
k = 0
For i = 102 To 155
Set d = Worksheets("User Entry").DropDowns("Drop Down" & i)
rng.Offset(j, k).Value = d.Value
j = j + 1
If j > 17 Then
j = 0
k = k + 1
d.ListFillRange = Worksheets("Collected Data").TextBox2.Text
With Worksheets("Collected Data")
d = Worksheets("User Entry").DropDowns("Drop Down 154")
d1 = Worksheets("User Entry").DropDowns("Drop Down 155")
..Range("M1").Value = d.Value
..Range("M8").Value = d1.Value
d.ListFillRange = Worksheets("User Entry").TextBox2.Text
d1.ListFillRange = Worksheets("User Entry").TextBox2.Text
End With
End If
Next
End Sub