Object doesn't support this property or metheod ERROR

A

Ayo

I am having a problem with this line of code.

"pastDueWS.AutoFilter.Sort.SortFields.Clear"

It works fine on my computer, 2007, but not on my boss computer, 2003. Is
there a way to fix this?
 
G

Gary Brown

I don't believe 2003 has the AutoFilter.SORT method, just Application,
Filters, Parent and Range. SORT must have been added in 2007. ???
 
D

Dave Peterson

xl2007 changed the syntax that you can use when you sort the data--and it
records macros using this syntax.

You can still use the xl2003 (and before) syntax if you want in xl2007.

You can either record a sort macro in xl2003 or rely on your memory for
syntax--or maybe this would help.

with myrng
.cells.sort _
Key1:=.Columns(1), Order1:=xlAscending, _
key2:=.columns(3), order2:=xldescending, _
Header:=xlno, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
end with
 
A

Ayo

I am having a problem. There seem to be an issue with ":=" The whole
statement :
Key1:=.columns(1), Order1:=xlAscending, _
Key2:=.columns(4), Order2:=xlAscending, _
Key3:=.columns(3), Order3:=xlAscending, _
.Header = xlYes

is RED.
 
D

Dave Peterson

You didn't include the line above. The line starting with Key1:= is a
continuation of the previous line.
 
A

Ayo

This is what I have:
With pastDueWS.Range("A2:F" & pastDueWSlastRow)
.Cells.Sort_
Key1:=.columns(1), Order1:=xlAscending, _
Key2:=.columns(4), Order2:=xlAscending, _
Key3:=.columns(3), Order3:=xlAscending, _
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
End With
And this section:
Key1:=.columns(1), Order1:=xlAscending, _
Key2:=.columns(4), Order2:=xlAscending, _
Key3:=.columns(3), Order3:=xlAscending, _
.Header = xlYes

of it is all RED. And it seem to be indicating that ":=" is an error and I
can't figure out why.
 
Top