LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default MACRO Assistance Required

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula assistance required J.Scargill[_2_] Excel Worksheet Functions 3 April 6th 10 10:54 AM
Assistance required Anthony Excel Discussion (Misc queries) 1 June 2nd 06 11:14 PM
Formula assistance required!!! Don Excel Discussion (Misc queries) 4 February 22nd 05 08:34 PM
Macro assistance required please [email protected] Excel Programming 0 November 7th 03 08:30 AM
Excel Macro Program assistance required David Moen Excel Programming 3 November 5th 03 06:07 AM


All times are GMT +1. The time now is 07:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"