+ Reply to Thread
Results 1 to 3 of 3

Delete Cells with Specific Value and All Blank Cells Until Next Populated Cell is Checked

  1. #1
    Registered User
    Join Date
    04-29-2014
    Location
    Honlulu, HI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Delete Cells with Specific Value and All Blank Cells Until Next Populated Cell is Checked

    Column A of my spreadsheet has various data - many of which matches - followed by blank spaces. I would like to search and find the specific string, then delete it along with all of the blank cells (really the entire rows) that follow and finally continue the search and delete until all of Column A is complete.

    The following code will delete the specific string along with the entire row , but how to I delete the blank rows that follow on this string without deleting all blank rows in Column A before checking to see if that specific string is there?

    Dim r As Range
    Set RngofSrch = ActiveSheet.Range("A:A")

    Do
    Set r = RngofSrch.Find("string")
    If Not r Is Nothing Then r.EntireRow.Delete
    Loop While Not r Is Nothing

    Any insight you can provide would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Delete Cells with Specific Value and All Blank Cells Until Next Populated Cell is Chec

    Post a sample workbook with before and after examples.

  3. #3
    Registered User
    Join Date
    04-29-2014
    Location
    Honlulu, HI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Delete Cells with Specific Value and All Blank Cells Until Next Populated Cell is Chec

    Before.jpgAfter.jpgDesired.jpg

    Pic #1 is "Before" spreadsheet format
    Pic #2 is "After" spreadsheet format after current macro is run
    Pic #3 is "Desired" what I'd like the spreadsheet format to look like after macro is run

+ 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. [SOLVED] Return cells in a row if specific column is populated
    By Scott Boser in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2014, 03:56 PM
  2. [SOLVED] If check box is checked, then copy specific cells to new sheet
    By thedefense in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-10-2014, 02:46 PM
  3. Delete blank row above cells with specific words.
    By beyre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2012, 02:17 AM
  4. Replies: 4
    Last Post: 01-31-2012, 01:08 PM
  5. Blank cells are getting populated as null
    By Banerjee in forum Excel General
    Replies: 1
    Last Post: 05-29-2009, 04:51 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