Test for value and set row height

  • Thread starter Thread starter Jay Oken
  • Start date Start date
J

Jay Oken

I would like to test for a value in a cell (i.e. cell C3 >0) and if true
then set the row height to 0 then move the curser down one cell and run the
test again. I also need the code to run it in a loop a certain number of
times. Any help would be appreciated.

Thanks,
J
 
In a regular module:

Sub test()
Dim cell As Range
Dim rng As Range
Set rng = Range("C3:C20")
For Each cell In rng
With cell
If .Value > 0 Then
.RowHeight = 0
End If
End With
Next
End Sub
 

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

Back
Top