Consulting

Results 1 to 3 of 3

Thread: macros buttons & toolbars

  1. #1

    macros buttons & toolbars

    hi everyone

    just a quick little problem

    i would like to add some custom buttons to the toolbar and i would like these to run code in every spreadsheet that i open, i can do it but i have to write the code in a spreadsheet then add the buttons, but everytime i run the code that file opens, i have wrote some code wich then closes that file

    but just think it would be better if i could avoid this

    i know in word i can have the macros in the Normal Project and this runs for every word file that gets open

    also if i want to add the same buttons to several pcs on a network is there a quicker way of doing it without having to sit at each machine and manually do it?

    many thanks

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You could either create an addin and attach your buttons to that workbook, or attach them to the Personal.xls, which opens when Excel starts and hides itself if you put it in the XLSTART directory.


    Personal.xls is located in the XLStart directory, and is used to store macros and
    things that you want to be available to all workbooks, whenever you start
    Excel.

    By default, it is hidden in Excel, but if you go to the VBE, you use it as you can
    with any other open workbook (you don't have to unhide it).

    You can create it by
    - goto Tools>Macros>Record New Macro...
    - Choose Personal Macro Workbook form the dropdown
    - OK
    - click the Stop button on the toolbar that pops-up

    You now have a Personal.xls workbook. It is not visible though, it is hidden
    by default (Windows>Unhide)

    It is best to build the macros when the workbook (Personal.xls or addin) opens. Some suggestions can be found at John Walkenbach's menumaker workbook:
    http://j-walk.com/ss/excel/tips/tip53.htm

    And Dave Peterson's toolbar:
    http://www.contextures.com/xlToolbar02.html
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3

    thanks

    thanks for that, i thought i had done it before in a personal.xls but just couldnt see it

    thanks again i will give it a try

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •