This is working, sort of, it is doing what I want to the second tab in the workbook (CWS) BUT it is also doing the same steps to the first tab sheet 1(Columns) where my end user buttons are placed for my co-workers to use. How do I update this code to only work on the CWS tab?
VBA Code:
Sub Hide_Cells()
'Dim ws As Worksheet
Worksheets("CWS").Activate
Range("B1").Select
ActiveCell.FormulaR1C1 = "."
Range("D1").Select
ActiveCell.FormulaR1C1 = "."
Range("H1").Select
ActiveCell.FormulaR1C1 = "Current Equipment"
Range("Q1").Select
ActiveCell.FormulaR1C1 = "."
Range("A1").Select
Columns("B:AC").Select
Selection.Locked = True
Selection.FormulaHidden = False
Columns("AD:AK").Select
Selection.Locked = False
Selection.FormulaHidden = False
For Each ws In ActiveWorkbook.Worksheets
ws.Range("B:f,H:j, L:O, Q:T").EntireColumn.Hidden = True
Next ws
ActiveSheet.Protect Password:="12121212"
End Sub