ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Test for value and set row height (https://www.excelbanter.com/excel-programming/321217-test-value-set-row-height.html)

Jay Oken

Test for value and set row height
 
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



Jason Morin

Test for value and set row height
 
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

----
HTH
Jason
Atlanta, GA

-----Original Message-----
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


.



All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com