+ Reply to Thread
Results 1 to 4 of 4

VBA to remove blank rows from a range

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    VBA to remove blank rows from a range

    Hi all,


    I would like whether someone can please help me with the below. I found this code which basically will select a range and delete all blank rows in a particular range (see source below):

    https://officetricks.com/delete-empty-rows-in-excel/



    Please Login or Register  to view this content.
    I would like to modify it a bit so as to specify as well the sheet from which the rows have to be deleted. I.e. if the sheet is called "Test". The code should just delete the rows from the sheet called "Test".

    Problem being that if I run the code and I the active sheet is not "Test" it is deleting the rows of that other sheet. So I would like the VBA to just delete the rows on the sheet "Test"


    Can someone please help me out?

    Appreciate a lot your kind help!

    Thanks


    Keibri

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: VBA to remove blank rows from a range

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: VBA to remove blank rows from a range

    Change this line:
    Please Login or Register  to view this content.
    To this:
    Please Login or Register  to view this content.
    BSB

  4. #4
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: VBA to remove blank rows from a range

    Cheers guys!! Thanks for your help! It was awesome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can’t remove blank rows
    By gz3s36 in forum Excel General
    Replies: 10
    Last Post: 12-20-2017, 09:58 PM
  2. [SOLVED] Remove blank rows that aren't really blank (contain unused formulas)
    By painterartist in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2014, 02:01 PM
  3. [SOLVED] VBA to remove blank rows
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2013, 10:11 AM
  4. Remove blank rows
    By chiragvaya in forum Excel General
    Replies: 6
    Last Post: 12-29-2012, 05:11 AM
  5. remove blank rows and copy new range
    By twofootgiant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2010, 09:11 AM
  6. How to remove blank rows, then insert blank row conditionally, PLUS error proof
    By GTS115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2009, 11:39 AM
  7. [SOLVED] remove blank rows
    By [email protected] in forum Excel General
    Replies: 3
    Last Post: 02-20-2006, 11:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1