Hi, dondonordas,
maybe just add the unprotecting of the sheet before actually starting the code and protect it after the macro?
Sub insert()
'
' insert Macro
'
' Keyboard Shortcut: Ctrl+q
'
ActiveSheet.Unprotect Password:="dondon"
With ActiveCell
.EntireRow.insert , CopyOrigin:=xlFormatFromLeftOrAbove
With .Offset(0, 15).Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:="=ItemsAccountJan!$B$2:$B$13"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
.Offset(0, 16).FormulaR1C1 = _
"=IF(ISBLANK(RC[-1]),"""",VLOOKUP(RC[-1],ItemsAccountJan!C[-16]:C[-15],2,FALSE))"
.Offset(0, 17).FormulaR1C1 = "=RC[-14]"
End With
ActiveSheet.Protect Password:="dondon"
End Sub
Ciao,
Holger
Bookmarks