hmltnangel
Active Member
- Joined
- Aug 25, 2010
- Messages
- 290
- Office Version
- 365
- Platform
- Windows
Hi all.
Bit of an odd one. The code below should hide columns as requested. But when I run the Macro, Column AA wont hide. I even tried to be smart and record a basic macro to do that column specifically and then add Call MacroX in the code, but even then it wont hide the columns. BUT if I run MacroX separately on its own, it will hide it. In addition it randomly hides AE:AG as well. There is nothing in any other code in the workbook that refers to these columns. There are no merged cells in the columns that I can see. Whats causing the odd behaviour?
Bit of an odd one. The code below should hide columns as requested. But when I run the Macro, Column AA wont hide. I even tried to be smart and record a basic macro to do that column specifically and then add Call MacroX in the code, but even then it wont hide the columns. BUT if I run MacroX separately on its own, it will hide it. In addition it randomly hides AE:AG as well. There is nothing in any other code in the workbook that refers to these columns. There are no merged cells in the columns that I can see. Whats causing the odd behaviour?
VBA Code:
Sub Reset()
ActiveSheet.Unprotect "S3"
cells.Select
Selection.EntireColumn.Hidden = False
ActiveSheet.Range("C:C,P:P,R:R,T:T,X:X,AA:AA,AF:AF,AN:AN,AP:AP,AS:BB").EntireColumn.Hidden = True
ActiveSheet.Protect "S3"
End Sub