Question

Locked

VBA: How to hide merge column

By haris ·
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

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums