+ Reply to Thread
Results 1 to 1 of 1

VBA: Compare 2 data files exactly, ignore name

  1. #1
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    VBA: Compare 2 data files exactly, ignore name

    Hi all,

    I need to compare 1 file to many (say, 100 max). Even if their names differ, if the data inside them (specifically the cells, number of rows, perhaps some formatting too) are precisely the same,
    i must throw a flag. If the names are exact, i think an MD5 hash will probably work fine. Disallowing two like named files into the import process is not an option because the chances the files are named the same is probable. Forcing the user to rename every time is just not a desire-able approach.

    The filetypes may take 1 of 3 formats: .xls, .xlsx, .csv, and contain 100 to 5000 rows, up to 50 columns, all numeric data

    If i need to make things easier, i can limit the scope of this project to .csv only.

    To be more clear:
    The user will be importing a file for manipulation, should the file be the same as an already imported source, the user should know of this before proceeding.

    Other thoughts:
    Maybe i am overthinking this but...

    Option 1: Hash
    I would prefer to have some sort of hash string because ultimately i think thats the fastest way, I can just generate the hash for the source and compare to a hash table of existing.
    But i don't think this is possible with any hash algorithm.

    Option 2:
    I would write a function to check each individual cell for binary comparison, but that seems kind of cumbersome and possibly even painfully slow.


    Maybe this is unrealistic. Curious on your thoughts.

    Thanks
    Last edited by ironfelix717; 03-04-2020 at 02:36 PM.

+ 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 compare the data between 2 files and generate the count
    By Manish_Gupta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2014, 07:03 AM
  2. How to compare data from two excel files?
    By ThueO in forum Excel General
    Replies: 2
    Last Post: 06-04-2013, 12:47 AM
  3. How to compare data in CSV file and with data in .xlsx files.
    By phanikumar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2012, 07:20 AM
  4. Compare two files, move data conditionally
    By Marco-Kun in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-01-2011, 04:17 PM
  5. Compare data files
    By frankkerby in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2010, 01:58 PM
  6. [SOLVED] Compare and Calculate Data Between 2 Files
    By Beamers in forum Excel General
    Replies: 1
    Last Post: 01-09-2006, 10:45 AM
  7. [SOLVED] Compare Two Data Files
    By matthews_jd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2005, 11:05 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