Hello everyone,
I have a problem with protecting a sheet. Here is the problem: The sheet is password protected, then the VBA script unprotects the sheet, then the VBA script runs and finally re-password protects the sheet (nothing wrong with that). However, I require that the user of the sheet can use an auto filter that I set up on column A. The problem that I have is that when the VBA script has finished it passwords protects the sheet but it has not allowed the use of Auto Filter, even though I checked this box originally.
Any help would be very much appreciated.
Thanks in advance
Paul
Here is the code that I am using at present.
I have a problem with protecting a sheet. Here is the problem: The sheet is password protected, then the VBA script unprotects the sheet, then the VBA script runs and finally re-password protects the sheet (nothing wrong with that). However, I require that the user of the sheet can use an auto filter that I set up on column A. The problem that I have is that when the VBA script has finished it passwords protects the sheet but it has not allowed the use of Auto Filter, even though I checked this box originally.
Any help would be very much appreciated.
Thanks in advance
Paul
Here is the code that I am using at present.
Code:
ActiveWorkbook.Sheets("Induction Log").Activate
Application.ScreenUpdating = False
Sheets("Induction Log").Unprotect Password:="*******"
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtName.Value
ActiveCell.Offset(0, 1).Value = DateValue(txtDate.Text)
ActiveCell.Offset(0, 2) = txtPayroll.Value
ActiveCell.Offset(0, 3) = txtBuddy.Value
Application.ScreenUpdating = True
Sheets("Induction Log").Protect Password:="*******"