deleted non blank rows

vmccune
vmccune used Ask the Experts™
on
I want to find all the non blank rows on the current sheet starting at row 5 and delete them.

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Start here: http://excel.tips.net/T002386_Conditionally_Deleting_Rows.html

Simply modify the delete condition.
Rob HensonFinance Analyst

Commented:
If you are deleting non-blank rows, why not delete all?

The blank rows that are deleted as well will be replaced with new blank rows.

Thanks
Rob H

Author

Commented:
If I delete all, will that also delete a command button on the sheet?  How do I felete all?
Finance Analyst
Commented:
If the command button is anchored above row 5 then it would stay.

How are you determining your last used row?

Assuming you can pull the row value from this as a variable, lets call it n; you could then just select rows 6 to n and use EntireRows.Delete

Alternatively, create a blank template including buttons that you can copy and paste over the relevant area. Then you could clear the whole sheet.

Thanks
Rob H

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial