ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort problem in shared excel file (https://www.excelbanter.com/excel-programming/309504-sort-problem-shared-excel-file.html)

Jan Grinwis

Sort problem in shared excel file
 
Hi,

I do have a problem with a shared excel file.

Althought I am single using this shared file I constantly get an error
1004 when I run a macro to sort.

The macro looks like this:

Sub Sorteer()
Range("M11:AE55").Select
Selection.Sort Key1:=Range("M11"), Order1:=xlAscending,
Key2:=Range("N11" _
), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,
MatchCase:= _
False, Orientation:=xlTopToBottom
Range("M11").Select
End Sub

The error message is in Dutch but when I translate it should be
something like:

"For this operation all merged cells must have the same size"

In the sort range are no merged cells.
=================
When I do it manualy, with only 2 cells, I get the same error message.

What is my problem???

Thanks in advance

Jan

Jan Grinwis

Sort problem in shared excel file
 
(Jan Grinwis) wrote in message om...
Hi,

I do have a problem with a shared excel file.

Althought I am single using this shared file I constantly get an error
1004 when I run a macro to sort.

The macro looks like this:

Sub Sorteer()
Range("M11:AE55").Select
Selection.Sort Key1:=Range("M11"), Order1:=xlAscending,
Key2:=Range("N11" _
), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,
MatchCase:= _
False, Orientation:=xlTopToBottom
Range("M11").Select
End Sub

The error message is in Dutch but when I translate it should be
something like:

"For this operation all merged cells must have the same size"

In the sort range are no merged cells.
=================
When I do it manualy, with only 2 cells, I get the same error message.

What is my problem???

Thanks in advance

Jan


I found something else with is inportent te add
In the row with is no part of the sortrange is a merged cell.

Merged cell is A12..D12 and the sortrange is G10..I14
If I sort this there is an error.

If I sort a range and there are no merged cells in the same rows as
used in the sortrange there is no problem.

bug??

Jan


All times are GMT +1. The time now is 07:14 PM.

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