I think you will have to state your question more explicitly.
Have you tried first selecting all cell before you do your sort.
Ctrl+A (or in Excel 2003 invoke that twice)
If you are referring to lock cells as in protection, you have to
turn the protection off first like in a macro.
If you are referring to protection, what version of Excel.
There are differences and I can't help you beyond 2000.