There are a few different ways to lock cells in Excel. One way is to use the lock cells feature under the Review tab. To do this, select the cells you want to lock, and then click the lock cells button in the ribbon. This will lock the cells so that they can't be edited.
Another way to lock cells is to use the Protect Sheet feature. To do this, select the cells you want to lock, and then go to the Review tab and click the Protect Sheet button. This will bring up a dialog box where you can choose what you want to protect. You can choose to protect the cells, the sheet, or both.
Finally, you can also lock cells by using VBA code. To do this, select the cells you want to lock, and then open the VBA editor by pressing Alt+F11. In the VBA editor, insert the following code:
Range("A1:A10").Locked = True
This will lock the cells in the range A1:A10.