Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!



VBA: How to hide merge column

By haris ·

i'm getting this coding from here...

Sub FilterColumns()
' FilterColumns Macro
' Macro created 11/08/2007 by Alan
Dim MyRange As Range
Dim c As Range

' Set Range to Filter
Set MyRange = ActiveSheet.Range("a4:z4")
' Loop through Range
For Each c In MyRange
If c.Value = 0 Then
' Hide Column When Value Found
Columns(c.Column).Hidden = True
End If
End Sub

But i got problem for merge column...

example: i'm having merge column (b4 and c4), (d4 and e4) and etc... then i'm running this FilterColumns function... it will hide also column c4 and e4 also (i thinks because c4 and e4 also value= 0. Supposely i just want to hide empty merge column only... so how to solve it.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums