What do you mean by "lock"? Are you talking about "freezing" rows or columns, or about protecting cells?
If you want to freeze the top row and the left-most column, for example, follow the instructions here:
http://stackoverflow.com/questions/10915733/freezing-row-1-and-column-a-at-the-same-time