Question Locked

VBA: How to hide merge column

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hi,

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

thanks

1 reply

This discussion is closed to new replies.