I am trying to create an invoice sheet for my computer shop. I have never used excel really unless it was created for me.
My issue is that I want to lock a couple of cells after data is entered for example cells B13, C13, and H13 on sheet2 and so on.
I tried creating a macro
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim myRange As Range
On Error Resume Next
Set myRange = Intersect(Range("C13,B13,H13"), Target)
If Not myRange Is Nothing Then
Me.Unprotect
Target.Cells.Locked = True
Me.Protect
End If
End Sub
But it then locks all after the first one is entered. How can I set them to lock after only they are filled?
Bookmarks