I am an Excel novice and have never written/recorded a macro!
I have a protected worksheet with unlocked cells for data entry. When data is entered I would like to automatically change the cell's format to locked.
You can use the following VBA procedure. Click on the Developer button , then the Visual Basic button. If Sheet1 is the sheet on which you would like this to be done , double click on the Sheet1 text in the Project Explorer window on the left. A blank window will open. Copy the procedure given below into this.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Me.Unprotect
Target.Locked = True
Me.Protect
Application.EnableEvents = True
End Sub
Narayan
P.S. Remember that if any data entry error occurs , you cannot backtrack ! You will have to manually unprotect the worksheet and the cell which you would like to correct.