Hide/Unhide Col

unap2k

New Member
Joined
Jul 21, 2011
Messages
2
I am having a problem with my macro, when I run it "A:H" and "O:T" Still end up hidden, I want them unhiden.

Sub q2detail()
'
' q2detail Macro
'
'
Columns("A:EQ").Select
Selection.EntireColumn.Hidden = False
Columns("A:H").Select
Selection.EntireColumn.Hidden = False
Columns("I:N").Select
Selection.EntireColumn.Hidden = True
Columns("O:T").Select
Selection.EntireColumn.Hidden = False
Columns("U:AG").Select
Selection.EntireColumn.Hidden = True
Columns("AH:AH").Select
Selection.EntireColumn.Hidden = False
Columns("AI:AU").Select
Selection.EntireColumn.Hidden = True
Columns("AV:BH").Select
Selection.EntireColumn.Hidden = False
Columns("BI:CH").Select
Selection.EntireColumn.Hidden = True
Columns("CI:CI").Select
Selection.EntireColumn.Hidden = False
Columns("CJ:EP").Select
Selection.EntireColumn.Hidden = True
Range("D12:D13").Select
End Sub


-Thanks
Andrew
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to the Board!

Try without selecting:

Code:
Cells.EntireColumn.Hidden = False
Columns("A:H").EntireColumn.Hidden = False
Columns("I:N").EntireColumn.Hidden = True
Columns("O:T").EntireColumn.Hidden = False
Columns("U:AG").EntireColumn.Hidden = True
Columns("AH:AH").EntireColumn.Hidden = False
Columns("AI:AU").EntireColumn.Hidden = True
Columns("AV:BH").EntireColumn.Hidden = False
Columns("BI:CH").EntireColumn.Hidden = True
Columns("CI:CI").EntireColumn.Hidden = False
Columns("CJ:EP").EntireColumn.Hidden = True

HTH,
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top