david.segal
New Member
- Joined
- Jul 6, 2012
- Messages
- 3
I have recently inherited a spreadsheet at work with various macros included. One of the macros is currently pulling through an error despite it been the same as in a similar file.
I am currently unable to find the reason for the error. Can anyone help?
Thanks
Sub InsertRow()
On Error GoTo errorhandler
strPwd1 = "thames"
Sheets("Listing").Select
ActiveSheet.Unprotect (strPwd1)
Application.ScreenUpdating = False
Range("A6").Select
Selection.End(xlDown).EntireRow.Copy
Selection.End(xlDown).Offset(1, 0).Insert
Selection.End(xlDown).Select
Application.CutCopyMode = False
ActiveCell.Value = "Select..."
ActiveCell.Offset(0, 2).Value = "Select..."
ActiveCell.Offset(0, 3).Value = "Select..."
ActiveCell.Offset(0, 5).Value = "Select..."
ActiveCell.Offset(0, 6).Value = "Select..."
ActiveCell.Offset(0, 7).Value = "Select..."
ActiveCell.Offset(0, 8).Value = "Select..."
ActiveCell.Offset(0, 9).Value = "Select..."
ActiveCell.Offset(0, 10).Value = "Select..."
ActiveCell.Offset(0, 12).Value = "Enter Value..."
ActiveCell.Offset(0, 13).Value = "Select %..."
ActiveCell.Offset(0, 15).Value = ""
Call protectx
Application.ScreenUpdating = True
Exit Sub
errorhandler:
MsgBox ("There is an error - please contact Finance")
Application.ScreenUpdating = True
End Sub
I am currently unable to find the reason for the error. Can anyone help?
Thanks
Sub InsertRow()
On Error GoTo errorhandler
strPwd1 = "thames"
Sheets("Listing").Select
ActiveSheet.Unprotect (strPwd1)
Application.ScreenUpdating = False
Range("A6").Select
Selection.End(xlDown).EntireRow.Copy
Selection.End(xlDown).Offset(1, 0).Insert
Selection.End(xlDown).Select
Application.CutCopyMode = False
ActiveCell.Value = "Select..."
ActiveCell.Offset(0, 2).Value = "Select..."
ActiveCell.Offset(0, 3).Value = "Select..."
ActiveCell.Offset(0, 5).Value = "Select..."
ActiveCell.Offset(0, 6).Value = "Select..."
ActiveCell.Offset(0, 7).Value = "Select..."
ActiveCell.Offset(0, 8).Value = "Select..."
ActiveCell.Offset(0, 9).Value = "Select..."
ActiveCell.Offset(0, 10).Value = "Select..."
ActiveCell.Offset(0, 12).Value = "Enter Value..."
ActiveCell.Offset(0, 13).Value = "Select %..."
ActiveCell.Offset(0, 15).Value = ""
Call protectx
Application.ScreenUpdating = True
Exit Sub
errorhandler:
MsgBox ("There is an error - please contact Finance")
Application.ScreenUpdating = True
End Sub