L
Lindsay Graham
I have a simple macro that is supposed to call a named range 'Catalogue' and
sort it in a specified order. But I always get "Run-time error '1004':
This operation requires the merged cells to be identically sized."
The macro is:
Sub SortNFAuthor()
'
' SortNFAuthor Macro
' Macro recorded 13/9/2004 by Lindsay D. Graham
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Application.Goto Reference:="Catalogue"
Selection.Sort Key1:=Range("K3"), Order1:=xlAscending,
Key2:=Range("A3") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom
End Sub
The Header in the table to be sorted is 2 rows, and in some columns (but not
all) the 2 header cells are merged. If this is what's causing the problem,
why is it not a problem when I do the sort manually (ie, without using the
macro)? Can anyone help?
Lindsay Graham
Canberra, Australia
sort it in a specified order. But I always get "Run-time error '1004':
This operation requires the merged cells to be identically sized."
The macro is:
Sub SortNFAuthor()
'
' SortNFAuthor Macro
' Macro recorded 13/9/2004 by Lindsay D. Graham
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Application.Goto Reference:="Catalogue"
Selection.Sort Key1:=Range("K3"), Order1:=xlAscending,
Key2:=Range("A3") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom
End Sub
The Header in the table to be sorted is 2 rows, and in some columns (but not
all) the 2 header cells are merged. If this is what's causing the problem,
why is it not a problem when I do the sort manually (ie, without using the
macro)? Can anyone help?
Lindsay Graham
Canberra, Australia