I have a drop down menu (from Form Controls, Combo Box), which I want to assign a macro from an Add-In.
Is this possible?
The Add-In has been saved as an Excel Add-In, and turned on.
I have a drop down menu (from Form Controls, Combo Box), which I want to assign a macro from an Add-In.
Is this possible?
The Add-In has been saved as an Excel Add-In, and turned on.
@YasserKhalil
No, this does not work.
Can you upload your addin to have a look ..? Explain what is the procedure you would like to assign to?
@YasserKhalil
This is the code.
Once an item is selected from the drop down list, then Excel automatically goes to the cell which matches the item on the drop down.
I understand what you mean by having a macro bottom on the Quick Access Toolbar, but with this I need to make a selection from the drop down ... so I have to assign the macro to the drop-down (the macro works by selecting a drop down item, not clicking a macro button).
![]()
Please Login or Register to view this content.
Last edited by Un-Do Re-Do; 08-10-2017 at 11:01 AM.
Why don't you put this code om personal.xlsb file and you can use it at any workbook?
OK, maybe I will look at doing this. Thx for your help.
Assuming your addin is called MyCode.xlam and contains the Drop_Down routine you should be able to assign the macro to the drop down by using
MyCode.xlam!Drop_Down
Not sure what your routine is doing but you may need to qualify the Sheets and Range references so the correct information is used depending on whether the information should be coming from the addin or active workbook.
@Andy Pope
I want to have zero code in the workbook.
At the moment I do have something which refers to the add-in, "Application.Run ("'Add-In-C.xlam'!Drop_Down")".
I'm aiming for perfection though ... no code in the workbooks.
I don't think it can be done though.
I tried to trick Excel by writing the code in the workbook, assigning the macro by right-click, then loading the add-in and deleting the workbook macro at the same time ... didn't work though.
Did you try what I suggested?
There is no need for code in the workbook.
Load the addin which contains the Drop_Down routine.
In the workbook with the drop down control, or no code, select the drop down control and right click. Use Assign Macro.
In the macro dialog enter the name of the routine in full. So assuming your addin is called MyCode.xlam use the following
MyCode.xlam!Drop_Down
@Andy Pope
Cannot believe it. It works.
I just added apostrophes, in your example: 'MyCode.xlam'!Drop_Down.
Cheers.
Last edited by Un-Do Re-Do; 08-11-2017 at 04:40 AM.
Normally the single quote would only be needed if you had spaces in the filename.
Anyway glad you got it sorted.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks