Help..
the code listed below, has been working for well over a year, as its the original code that was created when i developed my spreadsheet. Now i have been making improvments through out the year, but never had a problem.
Sub InsertARow()
'
' InsertARow Macro
' Macro recorded 01/09/2008 by v14dmin
'
' Keyboard Shortcut: Ctrl+i
If ActiveSheet.Name <> "Timetabled Service" Then Exit Sub
ActiveSheet.Unprotect ("gideon")
Worksheets("Frequent Calculate").Unprotect ("gideon")
ActiveCell.EntireRow.Insert
ActiveCell.End(xlToLeft).Select
Range("Master_Row").Copy Destination:=ActiveCell
Worksheets("Frequent Calculate").Protect ("gideon")
ActiveSheet.Protect ("gideon"), DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowInsertingRows:=True, AllowDeletingRows:=True, AllowSorting:=True
'
End Sub
Now when the code gets excuted, I am presented with a run time error, stating that the sheet im trying to alter is protected etc
The line it then highlights is
Range("Master_Row").Copy Destination:=ActiveCell
The code does what its suppose to do i.e. insert a line from another sheet, then it produces the error, The active sheet is protected, but the sheet where the line comes from is no longer protected. Also I find that two of the cells within the line that is copied over, do not have there formulas in.
Now i cant work out why this is happening, as its never had any problems before
Any help or ideas why... ??
G
Bookmarks