Hi,
I am very new to VBA and am looking at a former colleague's worksheet. There is a macro in this worksheet which automatically creates 3 additional blank rows near the bottom of a spreadsheet.
Unfortunately this macro does not seem to be working any more. I have copied the code for the macro below.
Sub Insert_Row()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Worksheets("Detailed").Select
ActiveSheet.Unprotect Password:=PW
Range("DetIR").Offset(-1, 0).EntireRow.Hidden = False
Range("DetIR").Offset(-1, 0).EntireRow.Copy
Range("DetIRRange").Insert Shift:=xlDown
Range("DetIR").Offset(-1, 0).EntireRow.Hidden = True
Worksheets("Summary").Select
ActiveSheet.Unprotect Password:=PW
Range("SumIR").Offset(-1, 0).EntireRow.Hidden = False
Range("SumIR").Offset(-1, 0).EntireRow.Copy
Range("SumIRRange").Insert Shift:=xlDown
Range("SumIR").Offset(-1, 0).EntireRow.Hidden = True
Range("A1").Select
ActiveSheet.Protect Password:=PW
Worksheets("Detailed").Select
Range("A1").Select
ActiveSheet.Protect Password:=PW
Application.CutCopyMode = False
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
The row that the debugger selects as causing the error is:
Range("SumIR").Offset(-1, 0).EntireRow.Hidden = False
Any help will be very gratefully received.
Thanks
Bookmarks