How do I make 2 cells become one without changing column size

G

Guest

I want to create a cell the widtth of the entire excel document so I can put
a heading on the document without effecting column size.
 
D

Don Guillett

select columns>right click>format>alignment>horizontal>center across.
You can customize your toolbar to put the icon for this on the toolbar
I do NOT recommend merge cells.
 
R

Ragdyer

<<<"You can customize your toolbar to put the icon for this on the
toolbar">>>

Wasn't that *last available* in XL5.0?
 
G

Gord Dibben

There is no "center across selection" button available unless it has been added
in 2007

I added a button and a macro to toggle on/off.

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
 
G

Guest

Hi Gord, Thanks for your feedback but I don't know how to enter the info you
provided. Can you provide further assistance. I appreciate it.

Mike
 
D

Don Guillett

You're right. I forgot that I had added my own macro in personal.xls and
assigned to a custom button.

Sub CenterAcross()
Selection.HorizontalAlignment = xlCenterAcrossSelection
End Sub
 
G

Gord Dibben

Mike

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project by name and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.

To place a button on a Toolbar...Tools>Customize>Commands>Macros.

Drag the smiley-face button to your Toolbar.

Right-click and "Assign Macro". Select TOGGLECENTERACROSS and OK

Note: when you right-click you will also see "Change Button Image". There are
a bunch of button faces to pick from if you don't like smiley.


Gord

Hi Gord, Thanks for your feedback but I don't know how to enter the info you
provided. Can you provide further assistance. I appreciate it.

Mike

Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top