ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   A button for Center Across Selection (https://www.excelbanter.com/excel-discussion-misc-queries/112429-button-center-across-selection.html)

Jaleel

A button for Center Across Selection
 
In the old versions of Excel there was a button for Center Across Selection,
which has now turned to Merge and Center. If this button is pressed with
multiple rows, it swallows all the rows below the first row, whereas the old
version button functions it properly. Further this creates hassle with
sorting etc. I prefer the Merge and Center button to function as the old
Center Across Selection for multiple rows as we have a button now for merging
cells at the same time we do not have a button for Center Across Selection.
Am I right?

Jaleel

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc

Jim Cone

A button for Center Across Selection
 
Jaleel,
Add a custom button to a toolbar and assign this code to it...
'----------------
Sub CenterAcrossSelection()
On Error GoTo CenterErr
If TypeName(Selection) = "Range" Then
If IsNull(Selection.HorizontalAlignment) Or _
Selection.HorizontalAlignment = xlHAlignCenterAcrossSelection Then
Selection.HorizontalAlignment = xlHAlignGeneral
Selection.VerticalAlignment = xlVAlignBottom
Else
Selection.HorizontalAlignment = xlHAlignCenterAcrossSelection
Selection.VerticalAlignment = xlVAlignCenter
End If
End If
Exit Sub
CenterErr:
Beep
End Sub
------------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Jaleel"
wrote in message
In the old versions of Excel there was a button for Center Across Selection,
which has now turned to Merge and Center. If this button is pressed with
multiple rows, it swallows all the rows below the first row, whereas the old
version button functions it properly. Further this creates hassle with
sorting etc. I prefer the Merge and Center button to function as the old
Center Across Selection for multiple rows as we have a button now for merging
cells at the same time we do not have a button for Center Across Selection.
Am I right?
Jaleel



Gord Dibben

A button for Center Across Selection
 
I cannot recall any version of Excel having a "Center acrosss selection" button.

I built a macro years ago when running Excel 97.

Sub TOGGLECENTERACROSS()
With Selection
If .HorizontalAlignment = xlCenterAcrossSelection Then
.HorizontalAlignment = xlGeneral
Else
Selection.HorizontalAlignment = xlCenterAcrossSelection
End If
End With
End Sub


Gord Dibben MS Excel MVP

On Mon, 2 Oct 2006 06:35:02 -0700, Jaleel
wrote:

In the old versions of Excel there was a button for Center Across Selection,
which has now turned to Merge and Center. If this button is pressed with
multiple rows, it swallows all the rows below the first row, whereas the old
version button functions it properly. Further this creates hassle with
sorting etc. I prefer the Merge and Center button to function as the old
Center Across Selection for multiple rows as we have a button now for merging
cells at the same time we do not have a button for Center Across Selection.
Am I right?

Jaleel

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc



grinny

A button for Center Across Selection
 
In my V2003 Center Across Selection is available in Format Cells | Alignment
| Text Alignment, Horizontal -- scroll down.
--
Grinny


"Jaleel" wrote:

In the old versions of Excel there was a button for Center Across Selection,
which has now turned to Merge and Center. If this button is pressed with
multiple rows, it swallows all the rows below the first row, whereas the old
version button functions it properly. Further this creates hassle with
sorting etc. I prefer the Merge and Center button to function as the old
Center Across Selection for multiple rows as we have a button now for merging
cells at the same time we do not have a button for Center Across Selection.
Am I right?

Jaleel

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc


Jaleel

A button for Center Across Selection
 
Thanks Jim. Thanks Gord. It worked perfectly. Now I have a button for CAS.

Regards,

Jaleel

"Jaleel" wrote:

In the old versions of Excel there was a button for Center Across Selection,
which has now turned to Merge and Center. If this button is pressed with
multiple rows, it swallows all the rows below the first row, whereas the old
version button functions it properly. Further this creates hassle with
sorting etc. I prefer the Merge and Center button to function as the old
Center Across Selection for multiple rows as we have a button now for merging
cells at the same time we do not have a button for Center Across Selection.
Am I right?

Jaleel

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc



All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com