Conditional Hiding of Rows

G

Guest

I have a similar problem to a below post with the same title but instead it being about an entire column, I'm trying to hide the zero values in just a range of cells. I've been trying to get the below macro to work but it's just not happening for me. Can anyone suggest the necessary changes? The Macro is to hide zero values in column 6, rows 13 to 70.

Sub hide_rows()

For rwIndex = 13 To 70
For colIndex = 6 To 6
With Worksheets("UCS").Cells(rwIndex, colIndex)
If .Value = 0 Then EntireRow.Hidden = True
End With
Next colIndex
Next rwIndex
End Sub

Thanks for any advice you can give.

I know Autofilter can do a similar job but I'd like to get this to work.

Cheers,

AMcB
 
J

jeff

Hi,

You're close - it should be .EntireRow.Hidden = True
(add the period)

jeff
-----Original Message-----
I have a similar problem to a below post with the same
title but instead it being about an entire column, I'm
trying to hide the zero values in just a range of cells.
I've been trying to get the below macro to work but it's
just not happening for me. Can anyone suggest the
necessary changes? The Macro is to hide zero values in
column 6, rows 13 to 70.
 

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

Top