Closed Thread
Results 1 to 4 of 4

VBA: Deleting rows that do not contain a specific character

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    VBA: Deleting rows that do not contain a specific character

    Saying I'm a beginner to VBA would be an overstatement. I'm a beginner in that I just now installed it for Excel 2007 for the first time. I registered an account here in order to view this thread: Deleting rows based on conditional formatting. It helped a little.

    At work, I've been tasked with figuring out how to delete all rows in a spreadsheet which are not flagged as invalid data. When imported to Excel from the .csv file, there is a column containing the flags. I want to delete all rows of data which do not contain a "C" flag in the final column. Since I will need to do this for multiple workbooks containing tens of thousands of rows each, I realized it's time to learn how to use VBA rather than doing this manually.

    I used the conditional formatting feature to highlight all cells in the flag column containing "C". I'm sure this can probably be done without conditional formatting, too.

    Baby steps.

    I have no background knowledge in any sort of coding. I've been reading a Visual Basic tutorial, but it's still sort of Greek to me.

    I've attached a test file. I need to delete all rows that do not contain the letter C in column J.

    From the tutorial, I have:

    Please Login or Register  to view this content.
    Where I have “B<” I need a way to specify to delete all rows not containing C, or all rows which do not have a highlighted cell in the test file.

    Any help will be greatly appreciated! Thank you in advance
    Attached Files Attached Files
    Last edited by SaraLynne; 07-26-2013 at 01:12 PM.

  2. #2
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: VBA: Deleting rows that do not contain a specific character

    Is this solved?

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: VBA: Deleting rows that do not contain a specific character

    Quote Originally Posted by arlu1201 View Post
    Is this solved?

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    Sorry, I posted this in the wrong subforum and didn't know how to delete it. The responses can be found here: Solution

  4. #4
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: VBA: Deleting rows that do not contain a specific character

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Deleting rows if specific cell is blank or have specific text
    By JoaoFerreira1985 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2013, 01:18 PM
  2. Replies: 2
    Last Post: 11-09-2011, 11:47 AM
  3. Macro help deleting rows with selected character strings
    By rliccion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2009, 01:45 PM
  4. Deleting Specific Rows
    By phillim in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2008, 06:12 PM
  5. Deleting Specific Rows
    By ScaffoldingDepot in forum Excel General
    Replies: 2
    Last Post: 05-04-2005, 12:06 PM

Tags for this Thread

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