+ Reply to Thread
Results 1 to 5 of 5

Custom number format button

  1. #1
    Ken G.
    Guest

    Custom number format button

    I'd like to create a toolbar button linked to a custom number format so that
    clicking on the button would re-format the active cell or range to my custom
    format.

  2. #2
    Norman Jones
    Guest

    Re: Custom number format button

    Hi Ken,

    Alt-F11 to enter the VBE
    Insert | Module
    Paste the following code:

    '===========>>
    Public Sub aTester()
    Selection.NumberFormat = "#,##0_);[Red](#,##0)"
    End Sub
    '<<===========

    Alt=F11 to return to Excel

    View | Toolbars | Customize | Select 'Commands' tab
    Select 'Macros' in the left-hand Categories window
    Drag the smiley icon ftom the commands window to your toolbar
    Right-click the smiley | Assign Macro
    Enter (or select) the name of your macro
    OK | Close

    Change the macro's number format to your required format.

    Change the macro name to suit.

    ---
    Regards,
    Norman



    "Ken G." <[email protected]> wrote in message
    news:[email protected]...
    > I'd like to create a toolbar button linked to a custom number format so
    > that
    > clicking on the button would re-format the active cell or range to my
    > custom
    > format.




  3. #3
    Ken G.
    Guest

    Re: Custom number format button

    Thanks Norman - exactly what I wanted. Can the smiley button be edited or
    replaced?

    "Norman Jones" wrote:

    > Hi Ken,
    >
    > Alt-F11 to enter the VBE
    > Insert | Module
    > Paste the following code:
    >
    > '===========>>
    > Public Sub aTester()
    > Selection.NumberFormat = "#,##0_);[Red](#,##0)"
    > End Sub
    > '<<===========
    >
    > Alt=F11 to return to Excel
    >
    > View | Toolbars | Customize | Select 'Commands' tab
    > Select 'Macros' in the left-hand Categories window
    > Drag the smiley icon ftom the commands window to your toolbar
    > Right-click the smiley | Assign Macro
    > Enter (or select) the name of your macro
    > OK | Close
    >
    > Change the macro's number format to your required format.
    >
    > Change the macro name to suit.
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Ken G." <[email protected]> wrote in message
    > news:[email protected]...
    > > I'd like to create a toolbar button linked to a custom number format so
    > > that
    > > clicking on the button would re-format the active cell or range to my
    > > custom
    > > format.

    >
    >
    >


  4. #4
    Norman Jones
    Guest

    Re: Custom number format button

    Hi Ken,

    > Can the smiley button be edited or > replaced?


    Right-click the smiley | Customize | Right-click the smiley |
    'Change button image' | Select desired icon | Close

    ---
    Regards,
    Norman



    "Ken G." <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Norman - exactly what I wanted. Can the smiley button be edited or
    > replaced?
    >
    > "Norman Jones" wrote:
    >
    >> Hi Ken,
    >>
    >> Alt-F11 to enter the VBE
    >> Insert | Module
    >> Paste the following code:
    >>
    >> '===========>>
    >> Public Sub aTester()
    >> Selection.NumberFormat = "#,##0_);[Red](#,##0)"
    >> End Sub
    >> '<<===========
    >>
    >> Alt=F11 to return to Excel
    >>
    >> View | Toolbars | Customize | Select 'Commands' tab
    >> Select 'Macros' in the left-hand Categories window
    >> Drag the smiley icon ftom the commands window to your toolbar
    >> Right-click the smiley | Assign Macro
    >> Enter (or select) the name of your macro
    >> OK | Close
    >>
    >> Change the macro's number format to your required format.
    >>
    >> Change the macro name to suit.
    >>
    >> ---
    >> Regards,
    >> Norman
    >>
    >>
    >>
    >> "Ken G." <[email protected]> wrote in message
    >> news:[email protected]...
    >> > I'd like to create a toolbar button linked to a custom number format so
    >> > that
    >> > clicking on the button would re-format the active cell or range to my
    >> > custom
    >> > format.

    >>
    >>
    >>




  5. #5
    Ken G.
    Guest

    Re: Custom number format button

    Thanks again. I now remember doing this years ago but havn't had the need to
    do it since.

    "Norman Jones" wrote:

    > Hi Ken,
    >
    > > Can the smiley button be edited or > replaced?

    >
    > Right-click the smiley | Customize | Right-click the smiley |
    > 'Change button image' | Select desired icon | Close
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Ken G." <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks Norman - exactly what I wanted. Can the smiley button be edited or
    > > replaced?
    > >
    > > "Norman Jones" wrote:
    > >
    > >> Hi Ken,
    > >>
    > >> Alt-F11 to enter the VBE
    > >> Insert | Module
    > >> Paste the following code:
    > >>
    > >> '===========>>
    > >> Public Sub aTester()
    > >> Selection.NumberFormat = "#,##0_);[Red](#,##0)"
    > >> End Sub
    > >> '<<===========
    > >>
    > >> Alt=F11 to return to Excel
    > >>
    > >> View | Toolbars | Customize | Select 'Commands' tab
    > >> Select 'Macros' in the left-hand Categories window
    > >> Drag the smiley icon ftom the commands window to your toolbar
    > >> Right-click the smiley | Assign Macro
    > >> Enter (or select) the name of your macro
    > >> OK | Close
    > >>
    > >> Change the macro's number format to your required format.
    > >>
    > >> Change the macro name to suit.
    > >>
    > >> ---
    > >> Regards,
    > >> Norman
    > >>
    > >>
    > >>
    > >> "Ken G." <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > I'd like to create a toolbar button linked to a custom number format so
    > >> > that
    > >> > clicking on the button would re-format the active cell or range to my
    > >> > custom
    > >> > format.
    > >>
    > >>
    > >>

    >
    >
    >


+ 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