+ Reply to Thread
Results 1 to 5 of 5

Compare Column Delete if no Match Macro

  1. #1
    Registered User
    Join Date
    01-08-2014
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    4

    Compare Column Delete if no Match Macro

    Hi, I have a Workbook that I am adding some features too and VBA is not my forte. But I am a quick learner. So looking for some guidance on the following process of my code.

    I have Column A which hosts a standard data set of information we might find in Column B. An example:
    Intraday Personal 52
    Personal Vacation Excused Unpaid 19
    Absence 47
    Tardy
    Absence Total 63
    Total



    As you can see from this example Column B often might even contain just a portion/string of the data from Column A.

    The goal here is to match if Column B is in Column A, if not delete Column A shift cells up, Check again.... Repeat until the word "Total" Matches from Column C to Column A.


    The end result should look like:

    Personal Vacation 52
    Excused Unpaid 19
    Absence 47
    Total 63

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Compare Column Delete if no Match Macro

    see attached file
    data is in sheet1. macro test and undo are in module

    run test and see sheet2

    to undo the macro run undo
    Attached Files Attached Files
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Registered User
    Join Date
    01-08-2014
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Compare Column Delete if no Match Macro

    Thanks vankheet, but I have reattached my book and posted it for you. Looking through your macro not sure it will fit my situation. I hope you will see why once you see more data.

    Maybe it will also make the situation more clear as to what my goal is/what I'm trying to do. I have added more data onto the data set in sheet1. The goal would be to take that data and make it look like sheet 3, on sheet 2 of course. There will not be headers like there currently is on sheet3.

    avatar 141002test.xlsm

  4. #4
    Registered User
    Join Date
    01-08-2014
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Compare Column Delete if no Match Macro

    FYI still looking for some guidance in how to build a macro to do this in vba. If anyone could give me some ideas on how it should function or could help break down what venkat did with his so I can better understand why it won't work on the full data set it would be greatly appreciated. VBA leaves me a little more stumped than working with java

  5. #5
    Registered User
    Join Date
    01-08-2014
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Compare Column Delete if no Match Macro

    Got some more time to play around with this project... Here is another sample of what I am trying to do, keep in mind my vba skills are tiny at the moment...


    Please Login or Register  to view this content.

+ 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. Compare 2 columns, delete cells with no match
    By cmd in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-22-2019, 04:52 AM
  2. Macro to find and delete column if cell match
    By jimbosguns in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2012, 12:49 PM
  3. Replies: 6
    Last Post: 05-24-2012, 09:14 AM
  4. Compare two sheets and delete row if match found
    By Steinwall in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2011, 03:25 PM
  5. Compare worksheets and delete those that don't match
    By Hootie in forum Excel General
    Replies: 3
    Last Post: 07-21-2010, 02:09 PM

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