Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50070

locking cells when populated along with a change event

$
0
0
Hi ,
I have one change event in sheet1 as follows

Code:

Private Sub Worksheet_change(ByVal Target As Range)
Sheets("Sheet2").Unprotect "abcd"
Sheets("Sheet1").Unprotect "abcd"
  If Target.Column = 16 And Target.Cells.Count = 1 Then
    Target.EntireRow.Copy Destination:=Sheets(2).Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    Target.EntireRow.Delete Shift:=xlUp
    End If
End Sub


I also want to incorporate another change aspect in this so that any cells C2:F2000 and cells I2:I2000, L2:L2000 when populated are locked even if the sheet is unprotected.
Is it possible?
I understand that there can only be one change event per sheet...

Many thanks
Kind regards

Viewing all articles
Browse latest Browse all 50070

Trending Articles