The way to work around what you have is to get rid of all merged cells.
What you see in your file is another example of why you should never use the
merge cells feature. Period.
You can accomplish the same appearance in your file by other means. Do
this: Open a new blank file. In A1 enter something. Anything. Now select
A1:H1. Now click on Format - Cells - Alignment tab. In the "Horizontal:"
space click on the down-arrow and click on "Center across selection". Done.
HTH Otto
>I have an excel spreadsheet in which I need to sort row with column
>headings
[quoted text clipped - 6 lines]
> Right now the macro gives an error message of "merged cells must be of
> identical sizes". Any way to work around this?
Don Guillett - 29 Sep 2006 13:32 GMT
Sub CENTERACROSS()'toggles in personal.xls assigned to menu button
With Selection
If .HorizontalAlignment = xlCenterAcrossSelection Then
.HorizontalAlignment = xlGeneral
Else
Selection.HorizontalAlignment = xlCenterAcrossSelection
End If
End With
End Sub
Sub CenterAcrossA()
Selection.HorizontalAlignment = xlCenterAcrossSelection
End Sub

Signature
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
> The way to work around what you have is to get rid of all merged cells.
> What you see in your file is another example of why you should never use
[quoted text clipped - 14 lines]
>> Right now the macro gives an error message of "merged cells must be of
>> identical sizes". Any way to work around this?
Rick - 29 Sep 2006 16:52 GMT
Thanks Otto, however my explanation probably wasn't clear enough as the
center across doesn't work. here is an example portion of the spreadsheet:
Employee ID Project 9/1 9/8 9/15
9/7 9/14 9/21
Joe Smith 777 ABCDE 20 24 30
Mary Doe 888 xyzrr 16 12 10
I can't sort this without losing the date range that I need to keep in tact.

Signature
Rick
> The way to work around what you have is to get rid of all merged cells.
> What you see in your file is another example of why you should never use the
[quoted text clipped - 14 lines]
> > Right now the macro gives an error message of "merged cells must be of
> > identical sizes". Any way to work around this?
Otto Moehrbach - 30 Sep 2006 21:00 GMT
Rick
It's not clear in your post what's in what row/column. I understand the
Employee, ID, and Project and the entries under that, but I don't understand
where all the dates and numbers go. Where does all that go and exactly what
cells are merged and what cells aren't merged. Be specific, like cell A5
has this, cell B5 has that, etc. Then tell us by what column you are trying
to sort. Tell us what is sorting properly and what is not. HTH Otto
> Thanks Otto, however my explanation probably wasn't clear enough as the
> center across doesn't work. here is an example portion of the
[quoted text clipped - 32 lines]
>> > Right now the macro gives an error message of "merged cells must be of
>> > identical sizes". Any way to work around this?