Hide values

P

PaulOakley

I am trying to hide values as found in the attached.

Can anyone help, i have asked thi s question in a previous thread bu
the VB is causing me problems, and i cant quite work out why, the macr
i have tried to use is present in the xls.

Thanks in advanc

+-------------------------------------------------------------------
|Filename: Summary.zip
|Download: http://www.excelforum.com/attachment.php?postid=4571
+-------------------------------------------------------------------
 
B

Bob Phillips

Sub Hidecolums()
Dim Lcolumn As Long
Dim MyRng As Range
Dim c As Range

Lcolumn = Cells(25, Columns.Count).End(xlToLeft).Column
Set MyRng = Range("C25", Cells(25, Lcolumn))

For Each c In MyRng
If c.Value = 0 And c.Value <> "" Then
c.EntireColumn.Resize(, 2).Hidden = True
End If
Next c
End Sub



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Similar Threads


Top