ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object doesn't support this property or metheod ERROR (https://www.excelbanter.com/excel-programming/440781-object-doesnt-support-property-metheod-error.html)

Ayo

Object doesn't support this property or metheod ERROR
 
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?

Gary Brown[_6_]

Object doesn't support this property or metheod ERROR
 
I don't believe 2003 has the AutoFilter.SORT method, just Application,
Filters, Parent and Range. SORT must have been added in 2007. ???
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"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

Object doesn't support this property or metheod ERROR
 
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

Ayo

Object doesn't support this property or metheod ERROR
 
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

Object doesn't support this property or metheod ERROR
 
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

Ayo

Object doesn't support this property or metheod ERROR
 
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
.


Ayo

Object doesn't support this property or metheod ERROR
 
Disregard my last reply. I figured it out. I forgot the space between .Sort
and _

"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

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


All times are GMT +1. The time now is 01:30 AM.

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