How can I get back in to macros that I made private in the past so that I can alter their code?

Glühbirne

New Member
Joined
Jul 5, 2012
Messages
6
Hello Everyone,

I recently started working in a workbook that I had made quite a few months ago. I had made my macros private because I didn't want users to be able to run them in any way except for through buttons that I had inserted. Now, I want to get back into my macros and work on the code some more, but I don't know how to get in to them to even see the code. I try right clicking on the worksheets and selecting "View Code", in Visual Basic but that doesn't do anything. I know that the macros are still there, because I had attached them to buttons, and those buttons still work and run them. Am I destined to never be able to get into my macros again, or is there a way to find them? Thanks in advance for your help.
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Press Alt+F11 to open the Visual Basic Editor. Look at the code in all the modules in your workbook.
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

ALT+F11 will open the VBE (Visual Basic Editor), where you can browse to your code. If it's not event code then it's most likely going to be stored in Modules.. Just look through each object in the Project Explorer until you find your code.

HTH,
 

Glühbirne

New Member
Joined
Jul 5, 2012
Messages
6
I don't see any modules. I'm looking in the "Project Explorer." Is this the correct place to look? All I see are all of my worksheets. Pardon my ignorance.
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092

ADVERTISEMENT

Are the macros in your PERSONAL.XLS?

What sort of buttons do you have?
 

Glühbirne

New Member
Joined
Jul 5, 2012
Messages
6
Are the macros in your PERSONAL.XLS?

What sort of buttons do you have?


I'm not sure. How can I check, or where might I find my PERSONAL.XLS?

I just have grey buttons that I got from going to the Developer Tap and clicking "Insert" in the Controls group and then selecting button from the "Form Controls" and dragging it to the place I wanted it. If I remember correctly, I attached the button to the macro before making the macro private, then made the macro private after the fact. The macros all start with "mac_" but other than that I can't even remember the exact names. :(
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092

ADVERTISEMENT

If you right click the button and choose Assign Macro you should be able to click Edit.
 

Glühbirne

New Member
Joined
Jul 5, 2012
Messages
6
Okay, when I do that I do get the macro name, but the only options are "New" and "Record." There is no option to "Edit."

At least I can get the exact names now though, which is a start, I guess.

Any other ideas? Could the whole module be hidden maybe? I certainly have learned my lesson not to hide things when I don't really know what I'm doing.
 
Last edited:

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
What is the name of the macro? If you click the button does the macro run? Maybe the workbook that contains it isn't open, but it will open if you click the button.
 

Glühbirne

New Member
Joined
Jul 5, 2012
Messages
6
What is the name of the macro? If you click the button does the macro run? Maybe the workbook that contains it isn't open, but it will open if you click the button.


"The macro may not be available in this workbook or all macros may be disabled." :confused: All macros are enabled, so it must be the former.
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,123,292
Messages
5,600,765
Members
414,405
Latest member
Zaurb

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
Top