You'd want something like this:
There are two problems, one trivial, one not so. The trivial problem is that End(xlUp) ignores hidden rows so it could be a lot less that the rows of data. This can be remedied by looking at the UsedRange.Rows.Count. That can be wrong but it will always be greater than or equal to the current number of rows of data.
The less trivial problem is that once you have set a value to 1 and the row is hidden, you can't see the row to unhide it, so you'll have to manually unhide all the rows to see and change the values in column Q.
Personally, I'd be inclined to use Autofilter to hide and unhide the rows.
Bookmarks