Good evening,
I have data in non-continuous cells in Range A49:A103. I want to count the blank cells in this range (this part is easy as there are lots of examples on the internet on how to do this.) From this forum: Counting Blank and Non-Blank cells.
Sub test() Dim iBlank, rng as Range Set rng = Range("A49:A103") rng.EntireRow.Hidden = False With WorksheetFunction iBlank = .CountBlank(rng) End With 'If there are less then 11 (10 or less) blank cells, all rows are to unhidden. All rows are already unhidden from above. If iBlank < 11 Then Exit Sub 'Since all rows are already unhidden, we can exit the Sub here Else 'If there are more than 10 Blank Cells, then we need to find and hide all extra rows Range("A##:A109").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True ' This is where I am stuck. If iBlank >10, then starting on the 11th blank until until A103, I would like to hide the entire row if the cells in Column A (A49:A103) are blank. How do I find the 11th blank cell in the range to replace the A## in the Else option of the If statement End If End Sub Thank you,
K.