Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming the item selected in the dropdown is the name of the range to copy:
Sub DropDown1_Click() Dim x As Range, strRange As String Dim sName as String, drpdwn as DropDown sName = Application.Caller set drpdwn = Activesheet.DropDowns(sName) if drpdwn.ListIndex < 0 then strRange = drpdwn.List(drpdwn.ListIndex) Set x = ActiveCell Worksheets("Clipboard").Range(strRange).Copy x End if End Sub Assumes a dropdown (combobox) from the Forms Toolbar. You shouldn't put x in parentheses - unless you want to refer to the value stored in the cell referenced by x. Apparently it has been working for you, but there are situations where this will cause an error. In VBA you put arguments in parentheses only when the function is returning a value that will be used or if you use the CALL statement. Copy is a method, but I would still follow the convention. -- Regards, Tom Ogilvy "Fletch" wrote in message ups.com... Thanks for the prompt response guys. I could use custom buttons but thought the tidier solution would be to assign each macro to an item in a drop down list. Thx. Andy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula assistance required | Excel Worksheet Functions | |||
Assistance required | Excel Discussion (Misc queries) | |||
Formula assistance required!!! | Excel Discussion (Misc queries) | |||
Macro assistance required please | Excel Programming | |||
Excel Macro Program assistance required | Excel Programming |