I have a worksheet were I’m attempting to hide Column H via a VBA routine. I have two subs, one to hide Column H; the other to unhide it. However, when I run the code to hide, it hides Column H plus the next two columns I&J. Running the routine to unhide column H unhides all three columns that where hidden. I can “manually” hide just column H but not via VBA. That is: select Column H only > click on highlighted Column H > right click mouse and select Hide.
Here’s my test code:
----------------- Hide Column H -----------------------
Sub Macro1()
Columns("H:H").Select
Selection.EntireColumn.Hidden = True
Range("C2").Select
End Sub
--------------------------------------------------------------
---------------- Unhide Column H ---------------------
Sub Macro2()
Columns("H:H").Select
Selection.EntireColumn.Hidden = False
Range("C2").Select
End Sub
--------------------------------------------------------------
Here’s my test code:
----------------- Hide Column H -----------------------
Sub Macro1()
Columns("H:H").Select
Selection.EntireColumn.Hidden = True
Range("C2").Select
End Sub
--------------------------------------------------------------
---------------- Unhide Column H ---------------------
Sub Macro2()
Columns("H:H").Select
Selection.EntireColumn.Hidden = False
Range("C2").Select
End Sub
--------------------------------------------------------------