|
| ||||||||||
| Tags: combo box, excel 2007, macro, office 2007, worksheet |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to activate a macro from combo box
|
|
#2
| |||
| |||
| Activate a macro from combo box
T to use the bloe code in combo box hope it works for you Code: Select Case ComboBox1.Value
Case "A1"
Call A1
Case "B1"
Call B1
Case "C1"
Call C1
Case "11"
Call ONE1
Case "22"
Call Two2
Case "33"
Call Three3
End Select |
|
#3
| |||
| |||
| How to activate a macro from combo box
Thank you for replying me but can you tell me where should i put this code because i don't have any idea about it ? Code: Select Case ComboBox1.Value
Case "A1"
Call A1
Sub A1()
'
' A1 Macro
'
'
ActiveWorkbook.Save
Range("M8:Q17").Select
Selection.ClearContents
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
Range("Z1:AD9").Select
ActiveWindow.ScrollColumn = 6
Selection.Copy
ActiveWindow.LargeScroll ToRight:=-1
Range("M8").Select
ActiveSheet.Paste
Range("A3").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub |
|
#4
| ||||
| ||||
| How to activate a macro from combo box
Can you tell me from where you had made your combo box, if you had made from View, then you need to have Control toolbar from View then goto green triangle icon and get your combo box in Design mode, after that you need to hold the cursor over the Combo box and right click on it and select Properties, Find "ListFillRange" enter the Range with you Macro names in i.e.. A1:A5 Double Click the Combo box, or right click and select "View Code". Paste the code into the window, between "Private Sub ComboBox1_Change() " and "End Sub". to end up |
|
#5
| |||
| |||
| How to activate a macro from combo box
Thank you for replying me i had pasted the code where you had said me but when i am trying to run the macro over there i am gettign an error message as Run-time error '1004': Unable to get the DropDown property of the worksheet class Can you tell me where i had made mistake. |
|
#6
| |||
| |||
| Re: How to activate a macro from combo box
In that case i would suggest you to add the following code too in your code and hope it works for you Code: Sub DropDown141_Change() With ActiveSheet.DropDowns(Application.Caller) Application.Run .List(.ListIndex) End With End Sub |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to activate a macro from combo box" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Which plan is good BSNL plan from BBG FN Combo 600 or BB Home Combo UL 750? | SupaBoy | India BroadBand | 8 | 01-12-2011 07:58 PM |
| Reliance 649 combo VS Airtel 699 combo | Anish-Mumbai | India BroadBand | 5 | 05-05-2010 09:45 AM |
| Dvd vhs combo | Theo | Hardware Peripherals | 3 | 04-08-2009 12:55 PM |
| C2D CPU, MOBO, RAM, GFX combo | drkrack | Buy Sell Computer Hardware | 11 | 05-11-2008 05:42 PM |
| SQL / PHP / HTML combo | jaykf014 | Software Development | 3 | 24-10-2008 10:23 PM |