|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I assign a macro to a button when the macro is in my personal workbook?
I was able to assign the macro when it was in the same workbook as my worksheet but as it turns out the macro will only work if it's outside of the workbook. I cannot figure out how the macro is called from the button's sub now that it's in the PERSONAL.XLSB!Macro2
Before: I could just simply use Code:
Private Sub CommandButton1_Click() Macro2 End Sub Code:
Private Sub CommandButton1_Click() PERSONAL.XLSB!Macro2 End Sub The original problem as I've read is that updating between workbooks would require that the macro be outside the workbooks. So I've moved it and it does work from the run macros menu. But now it won't work when assigned to a button because, I believe, I am not referencing it properly. |
#2
|
|||
|
|||
If the button is a shape you made, Right-click on the shape and choose Assign macro
|
#3
|
|||
|
|||
Quote:
Ok, when I tried it with a form button I made, it wouldn't work. But when I made a active x button it immediately asked which macro to assign to it. It now works! I didn't get the assign macro context in the menu when I right-clicked the original button. But I did notice that under the View menu and submenu macros that the use relative references was an available option. How does thatwork? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word doc bug when closing from userform command button click macro | Joe Patrick | Word | 1 | 07-05-2011 08:53 PM |
Launch macro sub after hitting "create pdf" button in word | webharvest | Word VBA | 1 | 06-29-2011 04:56 PM |
macro to transfer data from one workbook to another workbook | virsojour | Excel Programming | 5 | 02-01-2011 08:58 PM |
Macro Button | B2W | Excel | 2 | 06-18-2010 09:36 AM |
Select a range in one one workbook while working in other workbook | Slow&Steady | Excel | 1 | 02-21-2010 03:34 AM |