L
Legacy 330376
Guest
Hi All,
I have a VBA code which does the following-
* Hides a row if the values of column J and O are less than 12
It should look at row 3 and beyond.
The VBA code is below, any ideas why it is not working?
It does not come up with an error message or anything.
The cells which it looks for, are indexed formulas so I am not sure if it is because of this.
I would like to use the code in an automatic state so probably use the private sub worksheet change function.
I have a VBA code which does the following-
* Hides a row if the values of column J and O are less than 12
It should look at row 3 and beyond.
The VBA code is below, any ideas why it is not working?
It does not come up with an error message or anything.
The cells which it looks for, are indexed formulas so I am not sure if it is because of this.
I would like to use the code in an automatic state so probably use the private sub worksheet change function.
Code:
Sub Change()
Dim i As Long, lastRow As Long
Set wsDATA = ActiveSheet
With wsDATA
For i = 2 To lastRow
If (.Cells(i, "J") < "12" And .Cells(i, "O") < "12") Then
.Range("A" & i).EntireRow.Hidden = True
End If
Next i
End With
End Sub