Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
SM
 
Posts: n/a
Default Shortcut for centring whatever is in a cell?

Is there any keyboard shortcut for centring whatever is inside a
cell/selection of cells? For instance, in Word, "Ctrl E" will centre text
on a line. Is there anything similar for Excel?


  #2   Report Post  
Max
 
Posts: n/a
Default Shortcut for centring whatever is in a cell?

Don't think there's a built-in shortcut key,
but here's a play to set-up the centring for: CTRL+j
(Try on a spare copy/new book)

Press Alt+F11 (to go to VBE)
Click Insert Module
Copy and paste the sub CentreAcrossCells
below into the whitespace on the right

'---------
Sub CentreAcrossCells()
If Selection.Cells.Rows.Count 1 Then
GoTo Pop
End If
If Selection.Cells.Count = 1 Then
Selection.Cells.HorizontalAlignment = xlCenter
ElseIf Selection.Cells.Count 1 Then
Selection.Cells.HorizontalAlignment = xlCenterAcrossSelection
End If
Pop:
End Sub
'---------

Press Alt+Q (get back to Excel)

In Excel, press Alt+F8
Select "CentreAcrossCells" in the macro list
Click "Options"
Enter a "j" for the shortcut key OK

Test it out. In any sheet:
Select a single cell with text (say), press CTRL+j
The text will be centred in the cell

Select another cell with text and an empty cell just to the right of it,
then press CTRL+j. The text will be centred across both cells

Note that if you select more than one row, nothing will happen
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"SM" wrote in message
...
Is there any keyboard shortcut for centring whatever is inside a
cell/selection of cells? For instance, in Word, "Ctrl E" will centre

text
on a line. Is there anything similar for Excel?




  #3   Report Post  
pameluh
 
Posts: n/a
Default Shortcut for centring whatever is in a cell?

Max wrote a great reply but the short answer is that there is no shortcut key
sequence. I just use the center button on my formatting toolbar. :)

Good luck,

Pamela :)

"Max" wrote:

Don't think there's a built-in shortcut key,
but here's a play to set-up the centring for: CTRL+j
(Try on a spare copy/new book)

Press Alt+F11 (to go to VBE)
Click Insert Module
Copy and paste the sub CentreAcrossCells
below into the whitespace on the right

'---------
Sub CentreAcrossCells()
If Selection.Cells.Rows.Count 1 Then
GoTo Pop
End If
If Selection.Cells.Count = 1 Then
Selection.Cells.HorizontalAlignment = xlCenter
ElseIf Selection.Cells.Count 1 Then
Selection.Cells.HorizontalAlignment = xlCenterAcrossSelection
End If
Pop:
End Sub
'---------

Press Alt+Q (get back to Excel)

In Excel, press Alt+F8
Select "CentreAcrossCells" in the macro list
Click "Options"
Enter a "j" for the shortcut key OK

Test it out. In any sheet:
Select a single cell with text (say), press CTRL+j
The text will be centred in the cell

Select another cell with text and an empty cell just to the right of it,
then press CTRL+j. The text will be centred across both cells

Note that if you select more than one row, nothing will happen
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"SM" wrote in message
...
Is there any keyboard shortcut for centring whatever is inside a
cell/selection of cells? For instance, in Word, "Ctrl E" will centre

text
on a line. Is there anything similar for Excel?





  #4   Report Post  
Max
 
Posts: n/a
Default Shortcut for centring whatever is in a cell?

"pameluh" wrote:
... I just use the center button on my formatting toolbar. :)

Hey, clicking with the mouse doesn't count !
It must be only keystroke(s) <g
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the shortcut key for adding $ to a cell reference eg $c$3 Bryce Excel Worksheet Functions 2 September 14th 05 02:30 PM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
Shortcut for wrap text or vertical center in cell webbuzzard Excel Discussion (Misc queries) 6 July 18th 05 08:45 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"