+ Reply to Thread
Results 1 to 7 of 7

Sort by specific column & delete rows based on content

  1. #1
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Sort by specific column & delete rows based on content

    Hi all,

    I need help with code that does the following. Attached book has some sample data I need to sort A-Z by column B. Once sorted, any rows having content ONLY on column A, I need all those to be deleted.

    Attached book contains only 30 rows, but I usually deal with a few hundred or sometimes a few thousand rows per spreadsheet.

    Thanks for your help!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Sort by specific column & delete rows based on content

    Perhaps
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Sort by specific column & delete rows based on content

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Sort by specific column & delete rows based on content

    Hi Jindon,

    Thank you so much for your help. I tried the code and it sorted the data as needed but ... rows having data only on column A were not deleted. Not sure what's happening?

    Thanks

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Sort by specific column & delete rows based on content

    Correct, Should be like this
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Sort by specific column & delete rows based on content

    Hi AlphaFrog!,

    I tried your code and it worked exactly how I needed it. I'll test it tomorrow extensively at work and, if everything goes well, I'll mark this post as solved and will certainly add reputation to you!

    Thanks!

  7. #7
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Sort by specific column & delete rows based on content

    Hi both Jindon & Alpha Frog,

    First of all, I apologize it took me this long to get back to you guys. Both options work as intended. I'm marking this post as solved and adding reputation to the both of you.

    Thank you so much for your help!

+ 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. Macro to delete rows based on contents of specific column
    By WarZak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2015, 04:58 PM
  2. Use VBA to delete netire rows based on content of one column
    By Jemwig in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2013, 04:53 PM
  3. [SOLVED] Global Macro to delete row based on specific cell content expect for row 1
    By intercooler in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2012, 07:13 PM
  4. [SOLVED] Macro to delete rows if any cell contains specific content
    By adayoan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-31-2012, 07:11 PM
  5. How to delete all content in a row based on a column's content
    By mccalljohn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2011, 12:05 AM
  6. Delete Rows based on content
    By fmluder93 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-09-2009, 05:14 AM
  7. Sort Column, Delete Rows, Delete Column, Move Molumn, more inside?
    By motown in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-13-2008, 09:44 AM

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