Hi, Firstly i hope my title is good enough as ive seen many threads with bad titles.
i want to run a different macro for each of the selections in a dropdown list (combobox?), ive searched the web & found examples but some reason i couldn't get them to work, i was hoping i could ask the experts on this forum. it seems to be a simple task, so hoping to very quick response from you guys
my Macros are: HideComments & Unhidecomments.
It needs to work in both Excel 2003 & Execel 2010 as im doing it for work which uses 2003.
i would also like to ask a unrelated question but unsure if thats allowed here, so i will wait for a response & hoping you can tell me if i need a new thread.
Thank you for your time.
Smogsy.![]()
Last edited by smogsy; 09-05-2010 at 06:34 AM.
Use a change event on the sheet containing the DV list with an appropriate method to invoke based on value (eg Application.Run value)
Consider DV cell is B3 on Sheet1... with List Source as Macro1,Macro2
You might want to consider handling events etc depending on what the various routines are doing (if just comments related then Events should not be an issue)Sheet1 Object Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("B3")) Is Nothing Then With Range("B3") If .Value <> "" Then Application.Run .Value End With End If End Sub Module Sub macro1() MsgBox "Macro1" End Sub Sub macro2() MsgBox "Macro2" End Sub
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
i love you :D
so as long as the Macro name matches the DV list everything is perfect?![]()
Last edited by smogsy; 09-05-2010 at 06:34 AM. Reason: Solved
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks