Solved

Dynamically select and delete a range of rows in Excel

Posted on 2014-03-07
3
398 Views
Last Modified: 2014-03-07
For “Table 1” in the attached file in need a code that would dynamically select last row and delete all the blank rows below it except the blank row right above “Table 2”.  

Please see the attached file to get a better idea of what I’m trying to accomplish.  Please see the ‘Before’ and ‘After’ tab.  

The reason why I need something dynamic to accomplish this is that the number of rows in “Table 1” subject to change.
Example-Sheet.xlsx
0
Comment
Question by:KP_SoCal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 39913122
Try this:

Range([B4].End(xlDown).Offset(3), Cells(Rows.Count, 2).End(xlUp).End(xlUp).Offset(-1)).EntireRow.Delete

Open in new window

0
 

Author Closing Comment

by:KP_SoCal
ID: 39913929
Very clean!  Thank you!!!
0
 
LVL 39

Expert Comment

by:nutsch
ID: 39914048
Glad to help.

Thomas
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question