What determines location of VBA code from recorded macro?

terrypin

New Member
Joined
Dec 3, 2016
Messages
25
I recorded a macro (as a basis for editing, maybe with help here). But how are you supposed to know where to find the VBA code please?

I assumed it would be in PERSONAL.xlsb as a new module, But as you see it's replaced whatever was in Module 8, rather than creating Module 16.

Excel-VBA-Module-Location.jpg


What logic or inadvertent setting on my part gets it into Module 8?

Also, could I ask a couple of associated very basic queries please:

1. Is there any way to change 'Module 1' etc to meaningful names?
2. Or search for a macro name?
3. Is there a KB shortcut to stop a macro recording, rather than four clicks in my case: Classical Menu > Tools > Macro > Stop Recording
4. With many modules open, as I had here, can I close them all at once instead of individually?

--
Terry, East Grinstead, UK
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
not sure if this is exactaly it, but starting to record after the file has been saved, creates a new module, and if no save before hand places it into the last module recorded (that session). Just add a new module, name it as you want and then drag the bits you want to the main module and you could delete the bits that were trials that you don't want

changing names, look at the properties setting (normally below) and you can change the name to a single string, no spaces (underscores_ok)

start and stop can be accomplished by clicking on the little document bottom left with the upper red ball (TO START), without TO STOP
 
Upvote 0
Thanks mole999, I think l have it sorted now. Renaming those meaningless 'modules' is a big step forward, especially as some of my macros are 15-20 years old.

I have ExceI 365 and mainly use the CIassic Menu (add-on) because of many years familiarity with ExceI 2000 (under XP). There is no macro record start/stop button in that ribbon:

Excel365-ClassicMenu-Ribbon-2.jpg


Under the Developer menu, I do have that handy button:

Excel365-DeveloperMenu-Ribbon-1.jpg


--
Terry, East Grinstead, UK
 
Upvote 0
Thanks mole999! Didn't see your post until just after sending the following. Odd design IMO. I'd have expected a simple toggle, in a fixed position, inside the ribbon! And my screenshot annotation should of course now be "This is the Start Recording button".

--------------------

Solution from Lewis in excelforum.com. There's an innocuous icon bottom left:

Excel365-MacroRecordingButton.jpg


--
Terry, East Grinstead, UK



 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,337
Messages
6,124,340
Members
449,155
Latest member
ravioli44

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