+ Reply to Thread
Results 1 to 3 of 3

Is there a keyboard shortcut to center data in a cell?

  1. #1
    Phil_K
    Guest

    Is there a keyboard shortcut to center data in a cell?

    I was wondering if there is a keyboard shortcut for the button on the format
    toolbar for centering data in a cell. Any help is appreciated.

  2. #2
    Forum Contributor
    Join Date
    01-26-2005
    Posts
    108
    Record a macro to do the cnte and assign it a shortcut key.

    Start recording (Tools, Macros, Record New Macro)
    Give it a meaningful name (e.g. CentreText)
    Select your letter of choice (I use "e") and put that in the Shortcut Key field.
    Ensure macro is being recoprded in your "Personal Wookbook" to make it available in all workbooks.
    Click OK to start recording.

    Click the toolbar button to cente text.

    Stop recording (Tools, Macro, Stop Recording)

    Now you need to edit the recorded macro to remove any reference to the cell you centred during the recording.

    You may need to "unhide" the personal wookbook (Window, Unhide) first.

    To edit the macro ...
    Tools, Macro, Macros.
    Select your macro and click Edit.

    Make your macro look something like this ...

    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .ShrinkToFit = False
    .MergeCells = False
    End With

    ... and then quit (File, Quit).

    Re-hide your Personal workbook (Windows, Hide)

    Close Excel and you will be prompted to save your Personal Workbook - do so.


    Now to centre text, just press CTRL and whatever letter you chose above (I used "e").
    Tony

  3. #3
    David McRitchie
    Guest

    Re: Is there a keyboard shortcut to center data in a cell?

    Hi Phil,
    You would have to create a macro and assign your own button

    Creating a Center Across Selection Button (this is the code)
    http://exceltips.vitalnews.com/Pages...on_Button.html
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "Phil_K" <[email protected]> wrote in message news:[email protected]...
    > I was wondering if there is a keyboard shortcut for the button on the format
    > toolbar for centering data in a cell. Any help is appreciated.




+ 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