VBA Script for Excel to delete rows

I have a set of data on Sheet1 from columns A:AA.  I need a way to perform the following.  Check each row in Column Q, if it is blank then delete that entire row of data.  I need to perform this all the way down to the last row of data.
ksstormhunter1Asked:
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.

YamaafgCommented:
hi,

Please try this:

Sub RemoveBlankRows()
 
Dim rng As Range
 
Set rng = Range("Q1:Q1048576").SpecialCells(xlCellTypeBlanks)
 
rng.EntireRow.Delete
 
End Sub

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
ksstormhunter1Author Commented:
Thanks
Rob HensonFinance AnalystCommented:
If you sort on column Q the blanks will be at the top or bottom. Then just select and delete as normal.

If you need to keep the data in the order that it is, you can add a sequential id in another column and then resort on this after the blanks deleted.

Alternatively, you can filter on column Q for blanks and when deleting it will only delete the visible rows.
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.