I have been battling with this sheet for a couple of weeks and need to finish this off by protecting some cells. I have an existing macro button to add cells with V-lookups. Only problem is it pulls these V-lookups by copying the cell below it. They aren't protected, and this sheet will be used by multiple people meaning it will break often.
How do I copy a cell format within a macro and protect the new row that was just added? I want to protect columns C, F and J starting with row 4.
Here is my current code:
Private Sub CommandButton1_Click()
Rows("4:4").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C5").Copy
Range("C4").PasteSpecial Paste:=xlPasteFormulas
Range("F5").Copy
Range("F4").PasteSpecial Paste:=xlPasteFormulas
Range("K5").Copy
Range("K4").PasteSpecial Paste:=xlPasteFormulas
Range("J5").Copy
Range("J4").PasteSpecial Paste:=xlPasteFormulas
Application.CutCopyMode = False
End Sub
Any help would be amazing!
Bookmarks