This VBA code protects all worksheets in a workbook with the password "Password" when the workbook is opened. It locks all cells and drawing objects on each worksheet while allowing filtering. A message box will display informing the user that all worksheets are now protected.
This VBA code protects all worksheets in a workbook with the password "Password" when the workbook is opened. It locks all cells and drawing objects on each worksheet while allowing filtering. A message box will display informing the user that all worksheets are now protected.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as XLS, PDF, TXT or read online from Scribd
This VBA code protects all worksheets in a workbook with the password "Password" when the workbook is opened. It locks all cells and drawing objects on each worksheet while allowing filtering. A message box will display informing the user that all worksheets are now protected.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as XLS, PDF, TXT or read online from Scribd
Sub Button1 - Click Dim Ws As Worksheet For Each Ws in Worksheets If Not Ws - Name "Sheet1" Then Ws - Range ("A1:K1") .Columns - Autofit Next Ws End Sub
Dim Arrdata As Variant, I As Long 'Sheets ("Sheet2") .Activate Arrdata Range (Cells (1, 1), Cells (2, 1) ) .Value For I 1 To Ubound (Arrdata) Msgbox Arrdata (I, 1) Next I