Assigning macro [names] question

justme

Well-known Member
Joined
Aug 26, 2002
Messages
729
I have a series of macros in one workbook. When I assign them to a button the macro name is shown. On the last two macros I made when I go to assign them to a button I see the name of the file with a "!" after it, then the macro name followed by a "."Then the macro name again. What did I do?

I know I copied an existing macro to modify to make the new ones, but why the wierd names? How can I change so it offers only the macro name?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi, justme
(or should I say justyou :-) )

be happy the list is showing the workbooknames, so you're sure where they are
when you've only one workbook open then the workbooknames don't appear

or do you need something else ?
why would you not like to see those workbooknames ?

kind regards,
Erik
 
Upvote 0
Hello Erik

I have only the one workbook open. When I click the assign macro button some macros show only their name and the two in question list a file name along with the macro name.
 
Upvote 0
another filename ?

then you did assign the buttons to another workbook
or you copied them from another workbook
or you renamed the workbook (don't know if this is a possible reason

you will have to delete the workbook-part of the assignment

to avoid future problems don't let the workbookname in the assignment when you link macros to your buttons

a workaround could be
rename the workbook to the one the buttons are assigned to
(temporarely move or rename the other one)
save
rename again

this worked for me !!

kind regards,
Erik
 
Upvote 0
Is there a proper method to copy an existing module because your new one is going to be very similar? I copied the code then I inserted a new module and pasted the code. Then I changed the name of the Sub() routine and the name in the properties window.
 
Upvote 0
My trick - using often for userforms - is

open new workbook
in VBAwindow
drag module or form to other project
drag it back to the original
form has to be renamed first
module is renaming automatically
 
Upvote 0

Forum statistics

Threads
1,224,889
Messages
6,181,611
Members
453,056
Latest member
apmale77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top