I have the below code connected to a button intended to copy a sample row and add 10 more to the bottom of my data set.
It's driving my crazy that I can't get it to work!
Any help would be greatly appreciated. Happy to answer any questions
Sub AddRows()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ActiveSheet.Unprotect ("password")
Sheets("Data").Select
On Error Resume Next
If Sheets("Data").AutoFilterOn = True Then ActiveSheet.ShowAllData
lastrow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Application.CutCopyMode = False
Rows("3:3").EntireRow.Copy
Rows(lastrow + 1 & ":" & lastrow + 10).Insert Shift:=xlDown
Application.CutCopyMode = False
Rows(lastrow + 1 & ":" & lastrow + 10).EntireRow.Hidden = False
ActiveSheet.Protect ("password"), DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowFiltering:=True
End Sub
Bookmarks