A couple of things this macro can show.
1) You don't have to unprotect a sheet for VBA to act on it. You simply need to reapply the protection with a non-persistent flag UserInterfaceOnly:=True turned on. This keeps the protection active for the user, but not to VBA.
2) You don't need to "select" things to act on them via VBA. This macro shows how to address those ranges directly using a complete object address, so your macro never leaves the activesheet.
Option Explicit
Sub test()
Dim ws As Worksheet
Set ws = ActiveSheet
ws.Protect "password", DrawingObjects:=True, Contents:=True, Scenarios:=True, _
AllowInsertingRows:=True, AllowDeletingRows:=True, UserInterfaceOnly:=True
With Sheets("Room Template")
.Visible = True
.Rows("1:18").Copy
Application.EnableEvents = False
Selection.Insert xlShiftDown
Application.EnableEvents = True
.Visible = xlSheetVeryHidden
End With
End Sub
Bookmarks