+ Reply to Thread
Results 1 to 7 of 7

How to permanently add a custom button?

  1. #1

    How to permanently add a custom button?

    I want to change my $ icon to use *my* preference of currency format
    rather than "accounting". I created a new button and assigned a bit of
    code to it, and it worked great- until I closed that workbook and
    opened a new one. The icon is still there, but the code is not, so an
    error appears.

    How do I permanently add an icon? Or, how do I change the commands
    associated with an existing icon?

    Thanks for any assistance- I've been fussing over this for way too long!


  2. #2
    Registered User
    Join Date
    09-10-2003
    Location
    Detroit, MI
    Posts
    59
    Write your macro (or copy the code from the one already written) into the Personal.xls workbook and create your button there. The macro and button will then be available for all workbooks.
    Neopolitan (Florida Dreaming)

  3. #3
    Gord Dibben
    Guest

    Re: How to permanently add a custom button?

    The code is in the workbook you closed and that workbook should open when you
    click on your button.

    Does it not?

    Can Excel find it?

    What is the error message?

    To have a macro available for all workbooks, store it in your Personal.xls in
    XLSTART folder or into an add-in which you load through Tools>Add-ins.

    The Icon you added is stored with the Toolbars set-up in your *.XLB file.

    Apparently that saves properly since the Icon is showing up.


    Gord Dibben Excel MVP

    On 15 Mar 2005 07:44:54 -0800, [email protected] wrote:

    >I want to change my $ icon to use *my* preference of currency format
    >rather than "accounting". I created a new button and assigned a bit of
    >code to it, and it worked great- until I closed that workbook and
    >opened a new one. The icon is still there, but the code is not, so an
    >error appears.
    >
    >How do I permanently add an icon? Or, how do I change the commands
    >associated with an existing icon?
    >
    >Thanks for any assistance- I've been fussing over this for way too long!



  4. #4

    Re: How to permanently add a custom button?

    Gord- Thanks for your response. I'd like to make the code/button
    available globally without opening a secondary file. I'm using Excel
    2003; I searched for but could not locate a file called Personal.xls.
    Any recommendations?

    Thanks again for your help!


  5. #5
    Gord Dibben
    Guest

    Re: How to permanently add a custom button?

    Personal.xls is created the first time you record a Macro using Macro
    Recorder.

    Tools>Macro>Record New Macro. A dialog box will come up asking you name the
    macro and where to place it. Pick Personal Macro Workbook from the dropdown.
    Copy and paste a couple of cells then Stop Recording.

    You now have a Personal.xls in your Office\XLSTART folder. You can go to
    Visual Basic Editor(Alt+F11) to view the macro you just recorded in a Module.

    You can add more macros by recording or by typing/copying them into the
    Module.

    You can do a File>Save from there or better yet hit ALT + Q to return to the
    Excel window.

    Then with Personal.xls active, hit Window>Hide.

    When you close Excel you will be asked if you want to save Personal.xls. Yes!

    It will open hidden next time you start Excel.

    NOTE: when assigning macros to buttons or menu items you will have to precede
    the macro name with Personal.xls.

    i.e. Personal.xls!macroname

    An alternative to Personal.xls is to create an add-in(*.xla) with your macros
    in it and load it through Tools>Add-ins.

    The benefit of this is that you don't have to precede the macro name with the
    filename.

    A disadvantage is that you will not see the macros in the Tools>Macro>Macros
    dialog.


    Gord

    On 16 Mar 2005 04:00:52 -0800, [email protected] wrote:

    >Gord- Thanks for your response. I'd like to make the code/button
    >available globally without opening a secondary file. I'm using Excel
    >2003; I searched for but could not locate a file called Personal.xls.
    >Any recommendations?
    >
    >Thanks again for your help!



  6. #6

    Re: How to permanently add a custom button?

    Thanks for your help! Works like a charm.


  7. #7
    Gord Dibben
    Guest

    Re: How to permanently add a custom button?

    Good to hear and thanks for the feedback.


    Gord

    On 17 Mar 2005 06:40:01 -0800, [email protected] wrote:

    >Thanks for your help! Works like a charm.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1