• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

SortOn:=SortOnCellColor - Named argument not found

Emeng

Member
Hi all

I have copied & adapted the text of the macro recorder to sort by colour but receive the above error.

The code blows out on SortOn which is the last line of the procedure... so far.

Code:
Range("MyRange").Sort Key1:=Range("D" & newRow), SortOn:=xlSortOnCellColor, Order:=xlAscending, DataOption:=xlSortNormal

See attached file.

Any help is much appreciated

Thanks & regards

Mark
 

Attachments

  • Testbook_MG.xlsm
    222.4 KB · Views: 1
Emeng
Hint:
You should record again,
You needed macro
and
check - what is there.
After that,
use needed parts of it.
eg:
Where is 'clear'?
You've set MyRange variable as selection ... but later You are using "MyRange" ... hmm?

... and so on.
 
Back
Top