Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Elena01 pe Simpatie.ro
Femeie
19 ani
Braila
cauta Barbat
19 - 31 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] Using Macros in All Sheets in the PERSONAL.XLSB file [VBA] Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
Mrrrr
AdMiN

Inregistrat: acum 17 ani
Postari: 2186
The PERSONAL.XLSB (or .XLSM) file is a macro-enabled file, located in C:\Users\USERNAME\AppData\Roaming\Microsoft\Excel\XLSTART
(replace USERNAME with your user name)

It's purpose its to help you use macros in any normal excel files (XLS, XLSX) without having to save them as macro-enabled workbooks.

It isn't enabled by default, so in order to save a PERSONAL.XLSB file, you must go to the DEVELOPER ribbon (activate it from Excel Options - Customize Ribbon) and click on Record macro, then choose to Store macro in: Personal Macro Workbook, click OK, then immediately stop the macro recording.

Now go to Visual Basic (press ALT+F11 in excel), and in the list on the left side you will have the PERSONAL.XLSB file. Any modules you add to that file will be enabled in all excel files you open.

Note: if, for some reason, you don't see the Customize Ribbon in Excel Options, then you must add the record macro button manually.
Edit your Quick Access Toolbar, choose to look for commands from Developer Tab, select Record Macro and click the ADD button to put it in Quick Access Toolbar. You can remove Record Macro button after you save your PERSONAL.XLSB file.

************************** LONGER STEP BY STEP TUTORIAL BELOW: **************************

What is the PERSONAL.XLSB file?
It is a macro enabled file located in
C:\Users\USERNAME\AppData\Roaming\Microsoft\Excel\XLSTART
(replace USERNAME with your user name)

Is it automatically created when I install Office Excel?
No, it is not. You must create it yourself and then it'll always be there.

How do you create it yourself?

There are a few steps to do this, but you only do it once, so bear with me:

1. Open Excel. Either you create a new file on desktop or just open Excel, it doesn't matter.

2. You need to record a macro and you can do this 2 ways:
    A. Activate the Developer ribbon and use the Record Macro button existing there (you can deactivate it afterwards)
       - to activate the Developer tab you must go to you Excel options (File - Options in Excel 2013)
       - choose Customize Ribbon
       - on the right side frame, check the box in front of Developer, then click OK
       - go to the Developer ribbon and hit the Record Macro button, then jump to step 3 below
    B. Make a temporary Record Macro button, in case you don't want to activate the Developer ribbon
       - at the right side of your Quick Access Toolbar (the one above the ribbons usually that has a save button, undo and redo etc.) click on the downward arrow and choose More Commands
       - in the left side frame, instead of Popular Commands choose All Commands
       - press R then scroll and find Record Macro
       - press the Add button to add it to your QAT, then click OK
       - press the Record Macro button on your QAT toolbar and go to step 3 below
         Note: even though this is a bit longer than A, you can afterwards use the Record Macro button without having to go to the Developer Ribbon (which doesn't even need to be activated)
3. Don't change anything, just click the arrow on the drop-down list under Store macro in and select Personal Macro Workbook, then click OK

4. Click on the Stop Recording button (it's in the same place) or in QAT on the blue square your Record Macro button turned into.

5. Go to Visual Basic (ALT+F11)

6. In the treeview on the left notice that besides your current file, called eg VBAProject (Book1) there is also a VBAProject(PERSONAL.XLSB) file.

7. Under Modules there is your recorded macro called Module1. Edit it as per your preferences and needs.


_______________________________________


pus acum 6 ani
   
Mrrrr
AdMiN

Inregistrat: acum 17 ani
Postari: 2186
That assumes that when you press the record button and set it for Personal Macro Workbook it actually starts recording. And I had a macro already recorded in there. Weird, huh?

If it doesn't start recording into the Personal Macro Workbook and you don't see personal.xlsb in Visual Basic:
- I closed all my excel documents and opened a new book
- I tried to record to personal.xlsb again and this time it started recording
- I stopped it, went to VB to find my previously saved macro into personal.xlsb and the new empty one

But, before that I tried a solution posted here: which is:

Open a workbook and save as Personal.xls to:
C:\Program Files\Microsoft Office\Office 10\XLStart ----- in my case this folder was C:\Program Files\Microsoft Office\Office 15\XLStart

Close XL and re-open. Personal XLS opens as the main workbook. I got a tip from the board which uses options I recall to close the workbook and hide it. Can't be specific here I did not save the tip. Once this is done, Personal.xls loads each time XL is opened but book1 is displayed as opposed to personal.xls and you can record macros in the usual fashion.

I thought they were unrelated, because I wasn't happy with what the solution did, as for me instead of book1 being displayed, it opened personal.xlsx and I had to Save As... to another document, every time. So after I created the file in that folder in blue, I deleted it.

But maybe they were related. Dunno, that's why I posted both things I did.


_______________________________________


pus acum 6 ani
   
Pagini: 1  

Mergi la