Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Attaching drop down to macro

Hi all,

Forgive me if this turns out to be too easy, but I've a
nice, little macro that runs based on the value in a cell
from a drop down box. Right now, one has to select the
value, then run the macro. I'm sure there's a way to run
the macro from the drop down selection, but I just can't
figure it out.

Any help would be greatly appreciated.

Thanks a bunch,
Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Attaching drop down to macro

Depends upon what sort of drop-down.

If it is a Forms control, just right-click and assign your macro.

If it is a control toolbox control, create a control Click event and run
your macro in there.

If it is a Data Validation, and you have XL2000 or above, you can use
worksheet change event on the cell and run your macro in there.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pvdalen" wrote in message
...
Hi all,

Forgive me if this turns out to be too easy, but I've a
nice, little macro that runs based on the value in a cell
from a drop down box. Right now, one has to select the
value, then run the macro. I'm sure there's a way to run
the macro from the drop down selection, but I just can't
figure it out.

Any help would be greatly appreciated.

Thanks a bunch,
Paul



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Attaching drop down to macro

In the Worksheet Module:
(Data Validation List) cell is E5


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$5" Then
Application.Run Target.Value
End If
End Sub


--
HTH
Roger
Shaftesbury (UK)



"pvdalen" wrote in message
...
Hi all,

Forgive me if this turns out to be too easy, but I've a
nice, little macro that runs based on the value in a cell
from a drop down box. Right now, one has to select the
value, then run the macro. I'm sure there's a way to run
the macro from the drop down selection, but I just can't
figure it out.

Any help would be greatly appreciated.

Thanks a bunch,
Paul



Reply
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
Attaching Macro to Cell instead of button? Satchmo2006 Excel Discussion (Misc queries) 2 August 29th 07 10:20 PM
Need help with recording a macro, attaching a button oxicottin Excel Worksheet Functions 9 January 18th 07 05:20 PM
Attaching a 2 item list to a cell / drop-down? Enrique Mahecha Excel Discussion (Misc queries) 8 December 22nd 05 06:30 PM
Attaching a macro to a VB button on a form WildGlio Excel Worksheet Functions 2 March 25th 05 11:11 PM
Attaching a macro (module) code to button Todd Huttenstine[_2_] Excel Programming 1 December 29th 03 09:12 AM


All times are GMT +1. The time now is 10:09 PM.

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"