Hi,
I have a spreadsheet that originally contained a lot of merged cells in column H and the cells to the left of them were blank. This caused problems with the filter in column D even after I unmerged the whole of column H, so I began filling in the blanks in D with x's. This was really time-consuming because for some reason filtering column D to show only blanks (so I could fill the whole empty space with x's) didn't work, and these many sections with blanks alternated with those with text. So I tried this code to speed things up:
However, after a couple of minutes and me stopping the code, the cells in column D have been filled only up to row 11667. Any idea what is wrong with my code?
I have a spreadsheet that originally contained a lot of merged cells in column H and the cells to the left of them were blank. This caused problems with the filter in column D even after I unmerged the whole of column H, so I began filling in the blanks in D with x's. This was really time-consuming because for some reason filtering column D to show only blanks (so I could fill the whole empty space with x's) didn't work, and these many sections with blanks alternated with those with text. So I tried this code to speed things up:
VBA Code:
Sub fillblankcells()
Dim r As Integer
r = 11382
Do Until r = 33453
If Cells(r, 4) = "" Then
Cells(r, 4) = "x"
End If
r = r + 1
Loop
End Sub
However, after a couple of minutes and me stopping the code, the cells in column D have been filled only up to row 11667. Any idea what is wrong with my code?