A
Andrew Bourke
Hi
I am testing macros that worked in Excel 2003 under Excel 2007.
In the program I use, rows from a list (across several cells) are
sometimes removed and I then use the sort line below to remove the blank
rows left in the list. This then produces the error message below.
'--- Do an alpha sort to remove blanked out lines
Shd.Range("B5:BB40").Sort Key1:=Shd.Range("B5"), Order1:=xlAscending
Error message:
"sort method of the range class failed error 1004"
Is there a simple way around this ?
Interesting:
1. After I 'End' the error message and get back to the page where the
blank rows are I can then sort the rows OK using a slightly different
sort routine (sorted numerically by total instead of alphabetically).
2. When re-running the code back under Excel 2003 I now get the same
error as first appeared in Excel 2007 !!
I am testing macros that worked in Excel 2003 under Excel 2007.
In the program I use, rows from a list (across several cells) are
sometimes removed and I then use the sort line below to remove the blank
rows left in the list. This then produces the error message below.
'--- Do an alpha sort to remove blanked out lines
Shd.Range("B5:BB40").Sort Key1:=Shd.Range("B5"), Order1:=xlAscending
Error message:
"sort method of the range class failed error 1004"
Is there a simple way around this ?
Interesting:
1. After I 'End' the error message and get back to the page where the
blank rows are I can then sort the rows OK using a slightly different
sort routine (sorted numerically by total instead of alphabetically).
2. When re-running the code back under Excel 2003 I now get the same
error as first appeared in Excel 2007 !!