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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

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