Run time error '1004'

I

Ikan

Hi everyone,

I'm new to using excel. I have created a template that includes in it
a macro that sorts customers by their last name. Works fine when I run
it with Sheet unprotected, but when I protect the Sheet an error
message comes out when I ty to run the macro again that reads:

Run time error '1004'
Sort method of Range class failed

Sheet Unprotected

Range("C6:C12").Select
Range("A5:K12").Sort Key1:=Range("C6"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal


Sheet Protected ( second line down to last is highlighted)

Range("C6:C12").Select
Range("A5:K12").Sort Key1:=Range("C6"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

I would appreciate very much any help regarding how to fix this
problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top