ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Issue with Hiding Columns (https://www.excelbanter.com/excel-programming/359877-issue-hiding-columns.html)

chris100[_65_]

Issue with Hiding Columns
 

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


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=536574


Ikaabod[_22_]

Issue with Hiding Columns
 

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...


--
Ikaabod
------------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371
View this thread: http://www.excelforum.com/showthread...hreadid=536574


Rick Hansen

Issue with Hiding Columns
 
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

"chris100" wrote in
message ...

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


--
chris100
------------------------------------------------------------------------
chris100's Profile:

http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=536574




chris100[_66_]

Issue with Hiding Columns
 

Thanks guys,

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

Chri

--
chris10
-----------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...fo&userid=2516
View this thread: http://www.excelforum.com/showthread.php?threadid=53657


chris100[_67_]

Issue with Hiding Columns
 

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

--
chris10
-----------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...fo&userid=2516
View this thread: http://www.excelforum.com/showthread.php?threadid=53657



All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com