chrislenway
New Member
- Joined
- Apr 16, 2009
- Messages
- 44
I am perplexed!
I put together a program that when an item in the dropdown menu is selected, it will copy and paste information from specific cells to the indicated page. (Please see code) I am trying to re-create the same code using a new workbook, copying and pasting verbatim what is in the old workbook, and I get "Run-time error '1004': Unable to get the DropDowns property of the worksheet class".
Is something over my head happening here? Please help!
The code in the sheet I am using is as follows:
Private Sub ComboBox21_change()
Dim LastRow As Long
Dim DataRange As Range
Select Case ComboBox21
'Range("B5:I5").Select is your variable to make more comboboxes
Case "Bridge"
Range("B5:I5").Select
Selection.Copy
Sheets("Bridge").Select
Set DataRange = Range(Cells(2, 5))
LastRow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
LastRow = LastRow + 1
ActiveSheet.Paste
Case "Consultant"
Range("B5:I5").Select
Selection.Copy
Sheets("Consultant").Select
Set DataRange = Range(Cells(2, 5))
LastRow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
LastRow = LastRow + 1
ActiveSheet.Paste
End Select
Sheets("ActionItem").Activate
End Sub
There is also a module that controls a macro for the DropDown:
Sub DropDown_Click()
Dim cb As DropDown
Set cb = ActiveSheet.DropDowns(Application.Caller) 'drop down that called the sub
Rows(cb.TopLeftCell.Row).Range("B7:I7").Copy
Sheets(cb.List(cb.ListIndex)).Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
Application.CutCopyMode = False
End Sub
Can anyone tell me why it works in one spreadsheet, but not the new one? Did I miss something?
Thanks!
Chris
I put together a program that when an item in the dropdown menu is selected, it will copy and paste information from specific cells to the indicated page. (Please see code) I am trying to re-create the same code using a new workbook, copying and pasting verbatim what is in the old workbook, and I get "Run-time error '1004': Unable to get the DropDowns property of the worksheet class".
Is something over my head happening here? Please help!
The code in the sheet I am using is as follows:
Private Sub ComboBox21_change()
Dim LastRow As Long
Dim DataRange As Range
Select Case ComboBox21
'Range("B5:I5").Select is your variable to make more comboboxes
Case "Bridge"
Range("B5:I5").Select
Selection.Copy
Sheets("Bridge").Select
Set DataRange = Range(Cells(2, 5))
LastRow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
LastRow = LastRow + 1
ActiveSheet.Paste
Case "Consultant"
Range("B5:I5").Select
Selection.Copy
Sheets("Consultant").Select
Set DataRange = Range(Cells(2, 5))
LastRow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
LastRow = LastRow + 1
ActiveSheet.Paste
End Select
Sheets("ActionItem").Activate
End Sub
There is also a module that controls a macro for the DropDown:
Sub DropDown_Click()
Dim cb As DropDown
Set cb = ActiveSheet.DropDowns(Application.Caller) 'drop down that called the sub
Rows(cb.TopLeftCell.Row).Range("B7:I7").Copy
Sheets(cb.List(cb.ListIndex)).Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
Application.CutCopyMode = False
End Sub
Can anyone tell me why it works in one spreadsheet, but not the new one? Did I miss something?
Thanks!
Chris