Hi everyone, I'm very much new to excel and to the forum so please be kind
I found VBA code on this site from 2012 (courtesy of the user dspel79082), which solves a problem I was experiencing. I wanted to create a locked worksheet in which you can still insert and delete rows. However, I do not understand certain aspects of the code and would greatly appreciate if someone could run through each line and explain the syntax behind it.
Please find the code below:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 16384 Then
ActiveSheet.Unprotect
Range("f" & Target.Row).Offset(-1, 0).Select
Selection.Copy
Range(ActiveCell.Address).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A" & Target.Row).Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowInsertingRows:=True
End If
End Sub
Bookmarks