Issue with Hiding Columns

C

chris100

Hi all,

I'm having an issue with hiding columns. I have a worksheet with a
statement summary at the top and on row 20 filters to select customer
invoices.

Now, i set a macro to hide rows 1-19 and certain columns - say B, D, &
F. Hiding manually by highlightling and selecting hide works, but when
i replay back the macro it hides columns A-C, for example. I have no
idea why it does this and i experimented with using column widths at 0
instead, but with the same result.

I would post the code, but i don't have it right now (it's v.simple).
In the meantime if anyone has come across this problem before and knows
how to solve it i would be very very happy.

Thanks as always,

Chris
 
I

Ikaabod

Sub Test()
Range("1:19").EntireRow.Hidden = True
Range("B:B").EntireColumn.Hidden = True
Range("D:D").EntireColumn.Hidden = True
Range("F:F").EntireColumn.Hidden = True
End Sub

This will hide rows 1-19 and columns B,D, & F...
 
R

Rick Hansen

Hey Chris Try this,

Sub test()
Range("1:19").EntireRow.Hidden = True
Range("B:B,D:D,F:F").EntireColumn.Hidden = True
End Sub

enjoy , Rick
 
C

chris100

Thanks guys,

That looks familar to what i've tried. I'll give it a go and let yo
know. THanks for posting.

Chri
 
C

chris100

Works a charm thanks guys.

What i had done was use range.select then hide column. For some reaso
it didn't like this.

THanks again,

Chri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top