D
Dave
The following code works well if run manually but not when the file is open.
What can I do to remedy this?
Thanks.
Private Sub Workbook_Open()
ActiveSheet.Unprotect ' Unprotect the active sheet
' Sort the list by the first field when the workbook is opened.
Range("JobList").Sort Key1:=Range("headers").Columns, _
Order1:=xlAscending, Header:=xlYes
' Select next available row in the second column.
Cells(Range("JobList").Rows.Count, Range("JobList").Column + 1).Select
Selection.End(xlUp).Offset(1).Select
' Protect the active sheet without a password
ActiveSheet.Protect DrawingObjects:=False, _
Contents:=True, Scenarios:=False
End Sub
What can I do to remedy this?
Thanks.
Private Sub Workbook_Open()
ActiveSheet.Unprotect ' Unprotect the active sheet
' Sort the list by the first field when the workbook is opened.
Range("JobList").Sort Key1:=Range("headers").Columns, _
Order1:=xlAscending, Header:=xlYes
' Select next available row in the second column.
Cells(Range("JobList").Rows.Count, Range("JobList").Column + 1).Select
Selection.End(xlUp).Offset(1).Select
' Protect the active sheet without a password
ActiveSheet.Protect DrawingObjects:=False, _
Contents:=True, Scenarios:=False
End Sub