Jason44136
New Member
- Joined
- Jul 8, 2019
- Messages
- 18
- Office Version
- 365
- Platform
- Windows
Greetings experts...
I have a workbook with three summary sheets and 31 different sheets (1, 2, 3 …). On my "Setup" sheet, I have a command button that will have a macro assigned. I am trying to write the VBA to hide all columns on sheets 1-31 if the value in row 1 is "1". All sheets are protected, so I know we'd have to have an Unprotect and protect line in the VBA. I tried using some other suggestions from my other threads, but no luck. If the cells that trigger the 1 in row 1 change (and thus the 1 is no longer present)… this should update when the command button is pressed again. It does not need to update automatically. I should note that sheets 1-31 will always be identical with the row 1 value based on the setup sheet.
I would prefer the macro just works without having to use a command button at all, but having the button does not bother me.
I have a workbook with three summary sheets and 31 different sheets (1, 2, 3 …). On my "Setup" sheet, I have a command button that will have a macro assigned. I am trying to write the VBA to hide all columns on sheets 1-31 if the value in row 1 is "1". All sheets are protected, so I know we'd have to have an Unprotect and protect line in the VBA. I tried using some other suggestions from my other threads, but no luck. If the cells that trigger the 1 in row 1 change (and thus the 1 is no longer present)… this should update when the command button is pressed again. It does not need to update automatically. I should note that sheets 1-31 will always be identical with the row 1 value based on the setup sheet.
I would prefer the macro just works without having to use a command button at all, but having the button does not bother me.