Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

Ensuring a spreadsheet has only 420 rows in Excel

Experts,

I have mulitple worksheets within a workbook.  I want each worksheet to have only 420 rows and no more.  Is there a way in VB, I can delete all rows after row 420.

I have the spreadsheet set to display only up to 420, but however I am performing a delete operation which deletes rows from the original 420 when there is no data on the respective row.
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

I'm not a huge fan of this method I'm about to suggest, but you can hide all rows from 421 to the last row.  That will limit the display to row 420.

If you have a macro-based option that deletes the rows as you described, you could augment it to unhide an equal amount of rows below to keep the display at 420 rows.  

Regards,
-Glenn
ASKER CERTIFIED SOLUTION
Avatar of Subramani N
Subramani N

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
Just a follow-up:  If you do hide rows 421-onward, they will stay hidden even if you delete rows in the visible area.