I can't for the life of me figure out why this isn't working. It seems so straight forward, what am I missing?
This is what I have:
I'm trying to identify the cells in column E that are greater than 0.
When I run the code, all cells return True.
This is what I have:
s.xlsx | ||||||
---|---|---|---|---|---|---|
E | H | |||||
204 | Complete | |||||
205 | Complete | |||||
206 | Complete | |||||
207 | N/A | |||||
208 | Complete | |||||
209 | Complete | |||||
210 | Complete | |||||
211 | N/A | |||||
212 | Complete | |||||
213 | 5 | |||||
214 | Complete | |||||
215 | Complete | |||||
216 | Complete | |||||
217 | Complete | |||||
218 | Complete | |||||
219 | Complete | |||||
s |
I'm trying to identify the cells in column E that are greater than 0.
When I run the code, all cells return True.
VBA Code:
Sub test()
lr = Cells(Rows.Count, 1).End(xlUp).Row
For y = 2 To lr
If Rows(y).Hidden = False And Range("E" & y) > 0 Then Range("H" & y) = True
Next y
End Sub