I'd like to hide column "B" for all worksheets and set the Row height to 15 for all worksheets when I open the workbook. I tried a For Next Loop but I'm encountering run-time errors. Here's the code:
Originally I had this code which worked:
I just tried adding onto it. Any help would be great.
Thank you.
-Nick
Code:
Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Range("A2:A" & ws.Rows.Count).RowHeight = 15
ws.Columns("B").Hidden = True
ws.Protect Password:="wmd", Userinterfaceonly:=True
Next ws
End Sub
Originally I had this code which worked:
Code:
Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="wmd", Userinterfaceonly:=True
Next ws
End Sub
I just tried adding onto it. Any help would be great.
Thank you.
-Nick