Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

Dynamically select and delete a range of rows in Excel

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
KP_SoCal
Asked:
KP_SoCal
  • 2
1 Solution
 
nutschCommented:
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
 
KP_SoCalAuthor Commented:
Very clean!  Thank you!!!
0
 
nutschCommented:
Glad to help.

Thomas
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now