How to justify in merged cells
I detest merging, since it screws up selections, formatting, sorting,
etc. I'd suggest instead that you center across A1:E1. Something like
this:
Dim rOldSelection As Range
Application.ScreenUpdating = False
Set rOldSelection = Selection
Application.Goto objSheet.Range("A1:E1")
With Selection
.Item(1).Value = "My Title"
.HorizontalAlignment = xlCenterAcrossSelection
End With
Application.Goto rOldSelection
Application.ScreenUpdating = True
It's one of the few times I recommend using Select.
In article ,
"Bill Murphy" wrote:
I have merged 5 cells horizontally with:
objSht.Range("A1:E1").Merge
objSht.Cells(1, 1) = "My Report Title"
How can I center the report title in the merged cells?
|