Greetings all,
I would like to come up with a shorter code as opposed to duplicating below for each month. I know there is a way to do it but I'm not sure how. Ideas?
as opposed to...
Thanks in advance!
I would like to come up with a shorter code as opposed to duplicating below for each month. I know there is a way to do it but I'm not sure how. Ideas?
Code:
Sheets("JAN").Select
ActiveSheet.Unprotect Password:=Range("AI40")
Range("8:8, 10:10, 12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,55:55,57:57,59:59,61:61,63:63").EntireRow.Hidden = False
ActiveSheet.Protect Password:=Range("AI40"), DrawingObjects:=False, Contents:=True, Scenarios:=True, AllowFormattingCells:=True
as opposed to...
Code:
Sheets("JAN").Select
ActiveSheet.Unprotect Password:=Range("AI40")
Range("8:8, 10:10, 12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,55:55,57:57,59:59,61:61,63:63").EntireRow.Hidden = False
ActiveSheet.Protect Password:=Range("AI40"), DrawingObjects:=False, Contents:=True, Scenarios:=True, AllowFormattingCells:=True
Sheets("FEB").Select
ActiveSheet.Unprotect Password:=Range("AI40")
Range("8:8, 10:10, 12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,55:55,57:57,59:59,61:61,63:63").EntireRow.Hidden = False
ActiveSheet.Protect Password:=Range("AI40"), DrawingObjects:=False, Contents:=True, Scenarios:=True, AllowFormattingCells:=True
Sheets("MAR").Select
ActiveSheet.Unprotect Password:=Range("AI40")
Range("8:8, 10:10, 12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,55:55,57:57,59:59,61:61,63:63").EntireRow.Hidden = False
ActiveSheet.Protect Password:=Range("AI40"), DrawingObjects:=False, Contents:=True, Scenarios:=True, AllowFormattingCells:=True
Thanks in advance!
Last edited: