Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

Delete blank rows sub

Hi,

I have attached a ss where i want a piece of code that can count until the last row using ColA and then delete any blank rows (there is formula in the blank rows)

See attached

Thanks
Seamus
test1.xls
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Seamus2626

ASKER

Magic

Thanks Rory

Seamus
Just as an alternative solution:-


Sub Remove_Blanks()
Dim i As Integer
i = 2
While ExitCondition = False
    If Sheet1.Range("I" & i).Formula = "" Then ExitCondition = True
    If Sheet1.Range("A" & i).Value = "" Then
        Sheet1.Rows(i).Delete
    Else
        i = i + 1
    End If
Wend
End Sub

Open in new window

Thanks Funinig_Stroll, appreciate the additional info

Cheers,
Seamus