Excel vba - If cells in multiple columns are empty, delete row

Hello Experts!

Attached is a sample of the data I'm cleaning up.  I'll need to delete rows whenever the corresponding cells in Columns B:E are empty.  I have highlighted in yellow what satisfies that condition.  

I would very much appreciate your help with code to delete rows where the cells in B:E are empty.

Thank you!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Haris DulicIT ArchitectCommented:
No attachment
xllvrAuthor Commented:
Hi Haris,

I don't see a post or an attachment here.  Were you intending to comment?
Haris DulicIT ArchitectCommented:
In your question you are saying " Attached is a sample of the data I'm cleaning up. " but no attachment is there...
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

xllvrAuthor Commented:
Oh no!  So strange...I attached it but failed to hit upload earlier.  Apologies!

Here you go.
Haris DulicIT ArchitectCommented:

here is the code:
Private Sub CommandButton1_Click()

i = 1
j = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
Do While i < j
If i = 0 Then i = 1

If ActiveSheet.Range("B" & i).Value = "" And ActiveSheet.Range("C" & i).Value = "" And ActiveSheet.Range("D" & i).Value = "" And ActiveSheet.Range("E" & i).Value = "" Then
i = i - 1
j = j - 1
i = i + 1
End If


End Sub

Open in new window

Attached is the sample file without empty lines.. Just replicate it to your copy of file...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xllvrAuthor Commented:
That worked beautifully!  Thanks so much for a great solution, Haris.  I'm so appreciative.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.