Forum Discussion
WDave1975
Sep 26, 2020Copper Contributor
Removing blank lines
I've got a master sheet with data then I'm filtering a column and pulling that information into separate tabs, based on criteria. The master sheet is roughly 1,400 lines long. How do I remove blank...
NikolinoDE
Sep 26, 2020Platinum Contributor
Untested, you need to adjust the area / lines. Should actually work without a problem
Sub button1_click ()
Dim i As Long
'Customize sheet name
With Worksheets ("Sheet1")
For i = 140 To 5 Step -1
If WorksheetFunction.CountBlank (.Range ("J" & i & ": R" & i)) = 9 Then
.Rows (i) .Delete
End If
Next i
End With
End Sub
if you don't want to delete the lines but just hide them?
.Rows(i).Hidden = True
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.