you have to protect the sheet first - Review tab -changes-protect sheet button. Once thats done highlight cells you want to protect (lock) go to format cells - protect tab
You can always select all cells by using Ctrl-A and turn off the protection for everything first, and then just select the cells that you want protected and turn it back on for those.