Link to home
Start Free TrialLog in
Avatar of chris pike
chris pikeFlag for Canada

asked on

Excel - Macro hide columns not working

Hi Experts,
I have a worksheet that I need to hide certain columns with a macro, and with a second macro hide other columns.
But when ever I try to set the macro to even hide ONE column, it hides the entire table.

Once the macro works then I will need to select the first row, the table, and the last row to fit onto one landscape 8.5 by 11 sheet of paper.

The second macro will also do the same but with a different combination of columns selected.

There is one row above the table and on row under that I will also need to include to print.
When ever I try to macro one column it hides all columns A through AH which is the entire table.

Thanks so much

I have attached the dummy file./
dummy.xlsm
SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
either unmerge those cells or try something like this
Or my solution which has exactly the same effect.
Avatar of chris pike

ASKER

Thank you very much.
I didn't know that a merged cell would mess up the columns.