+ Reply to Thread
Results 1 to 4 of 4

Need help on how to compare data over twp workbooks and delete matching data from one.

  1. #1
    Registered User
    Join Date
    04-23-2022
    Location
    london
    MS-Off Ver
    office365
    Posts
    90

    Need help on how to compare data over twp workbooks and delete matching data from one.

    I have a workbook that has all the data that I use and also workbooks that have all the data that I have used and im trying to delete data that I have used from the workbook that has all the data.


    I have a workbook called TABLEAU that contains all the data also various other workbooks
    Im trying to get a macro that does the following.

    1) What I'm trying to do is first of all in the workbook called TABLEAU filter out in column G "CHEQUES AND CASH BANKED 95140" .

    2) I then need the macro to open the File called "CASH LIST PREVIOUS MONTH" Link to workbook below:-

    "https://sharepoint.com/teams/O365GRP-StationAccounts/Shared%20Documents/General/GLENN/CASH%20LISTS/CASHLISTPREVIOUS%20MONTH%20.xlsm"

    3) It then needs to looks at the data from each row in columns A-E and if there an exact match across all rows in workbook called "TABLEAU" then I need that line deleted from the workbook called "TABLEAU" Once that is done I need the workbook called CASHLIST PREVIOUS MONTH" closed.

    4) I then need it to open file called "CURRENT" Link to workbook below:-

    "https://sharepoint.com/teams/O365GRP-StationAccounts/Shared%20Documents/General/GLENN/CASH%20LISTS/CASH%20LIST%20CURRENT%20MONTH.xlsm"

    5) It then needs to looks at the data from each row in columns A-E and if an exact match across all rows in workbook called "TABLEAU" then I need that line deleted from the workbook called "TABLEAU" Once that is done I need the workbook called CASHLIST CURRENT MONTH" closed.

    What should of happened is all the data that's in cash list previous & current month would of been deleted from workbook called TABLEAU as already been used.


    6) I then need the workbook called TABLEAU to filter out in column I the number 48 and do exactly the same again,

    but opening this workbook

    Workbooks.Open Filename:= _

    "https://.sharepoint.com/teams/O365GRP-StationAccounts/Shared%20Documents/General/SHERE%20CURRENT%20MONTH.xlsm"

    7) It then needs to looks at the data from each row in columns A-D and if an exact match across all rows in workbook called "TABLEAU" then I need that line deleted from the workbook called "TABLEAU" Once that is done I need the workbook called SHERE CURRENT MONTH" closed



    The data in the workbooks that tableau comparing against are NOT in the same rows in both workbooks so I need each entry in the workbooks to look all the way down the workbook called tableau to find a match .




    Any Ideas?

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Need help on how to compare data over twp workbooks and delete matching data from one.

    Just going to speak generally here, as I've done this type of transform many times.

    If you need to strictly keep this in Excel, with no power query type manipulations, then you'll want to build a vba script that loops through both data sets and compares a common field (e.g. nested FOR loop that runs from the data set start to the last row) combined with conditional logic that either scrapes out the qualifying data into another sheet/workbook, or deletes the data row from the existing sheet.

    The better alternative would be to import your data into power query datasets, or some type of relational database like Access, SQLite, SQL Server etc. then you can easily transform using joins.

    If I needed to do what you are doing, I would definitely load all of my data into some type of standard platform that allows for relational analysis, instead of trying to manually manip. all these different files using scripting.

    Feel free to ask any questions, I'd be happy to point you in the right direction.
    Last edited by 1aaaaaaaaaaaaaaa; 07-19-2023 at 03:26 PM.

  3. #3
    Registered User
    Join Date
    04-23-2022
    Location
    london
    MS-Off Ver
    office365
    Posts
    90

    Re: Need help on how to compare data over twp workbooks and delete matching data from one.

    Many Thanks

    you have some brilliant Ideas. Can you get power query in normal excel program or is it an add on you havr to pay for?

    Ive only ever known macro's and still rusty on that. Is there any website or something that gives an idiot proof guide on how to do powerpoint?

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Need help on how to compare data over twp workbooks and delete matching data from one.

    I believe Power Query is included (for free) in Excel 2016 or later (also available as a free download for Excel 2010 and 2013)

    These ones look promising:

    https://www.simplilearn.com/tutorial...query-in-excel
    https://www.howtoexcel.org/the-compl...o-power-query/

+ 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. Replies: 0
    Last Post: 09-22-2020, 05:38 PM
  2. [SOLVED] How do I look for missing /duplicated data and delete matching data.
    By tweacle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2020, 03:22 PM
  3. Macro To Import Specific Data By Matching Data Between 2 Workbooks After User Picks File
    By Hackboss007 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-29-2016, 09:27 AM
  4. Replies: 1
    Last Post: 04-04-2014, 11:30 AM
  5. Compare Data from Two Sheets and Extra the matching data with all the columns
    By gatefire08 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-02-2014, 01:47 PM
  6. Compare Data between 2 Workbooks & Copy Add'l Data If Matched
    By Marcieface in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2013, 09:05 PM
  7. Compare data in selected columns and delete all matching rows
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2011, 09:35 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