Configuration of cells

O

Odarit

When I merge cells, Excel merges and centers the data to be placed
horizontally. However, the vertical alignment remains or is defaulted to
"bottom". How can I make Excell to center the merge cells to show data center
in either direction, vertical and horizontal?

Thanks
 
O

Odarit

Thanks John. The problem is that one you go to another cells or a different
workbook, you have to again format the cells using the procedure you just
mention. I was hoping to have it make "center-center" by default.

Odarit
 
K

Khoshravan

select all cells inside a worksheet and do what John says. It will affect all
cells. If you want the same effect for all sheets, then select all sheets you
want, by keeping shift and clicking on tabs.
 
J

Jim Cone

If you are not Vba phobic, then assign this sub to a button on a toolbar...
'---
Sub MergeAndAlign()
'Jim Cone - Portland, Oregon USA.
'Centers text (h & v) when merging cells and vice versa.
On Error GoTo Kaput
If TypeName(Selection) = "Range" Then
If Selection.Areas.Count > 1 Then
MsgBox "Select only one area.", vbInformation, _
"Merge Cells - Microsoft Excel"
Exit Sub
ElseIf Selection.Count > 1 Then
Application.ScreenUpdating = False
If Selection.MergeCells Or IsNull(Selection.MergeCells) Then
Selection.UnMerge
Selection.VerticalAlignment = xlVAlignBottom
Selection.HorizontalAlignment = xlHAlignGeneral
Else
Selection.Merge
Selection.VerticalAlignment = xlVAlignCenter
Selection.HorizontalAlignment = xlHAlignCenter
End If
Application.ScreenUpdating = True
End If
End If
Exit Sub
Kaput:
Beep
Application.ScreenUpdating = True
End Sub
--
Jim Cone
Portland, Oregon USA
(don't merge cells)



"Odarit" <[email protected]>
wrote in message
When I merge cells, Excel merges and centers the data to be placed
horizontally. However, the vertical alignment remains or is defaulted to
"bottom". How can I make Excell to center the merge cells to show data center
in either direction, vertical and horizontal?
Thanks
 
O

Odarit

Thans you all. Now I am cooking with gas!

Khoshravan said:
select all cells inside a worksheet and do what John says. It will affect all
cells. If you want the same effect for all sheets, then select all sheets you
want, by keeping shift and clicking on tabs.
 

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