View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Object doesn't support this property or metheod ERROR

Put a space character between the .Sort and the underscore.

.cells.sort _


Ayo wrote:

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.

"Dave Peterson" wrote:

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



Ayo wrote:

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.

"Dave Peterson" wrote:

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

Ayo wrote:

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?

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson