+ Reply to Thread
Results 1 to 7 of 7

VBA comparison spreadsheet

  1. #1
    Registered User
    Join Date
    06-09-2012
    Location
    london, england
    MS-Off Ver
    Excel 2007
    Posts
    4

    VBA comparison spreadsheet

    Hi,

    I am using a code to compare two spreadsheet.
    One of the function is to copy the modified records in a different worksheet, highlighting changes element in red.
    The script works, but ONLY when the cell is modified to "blank"(no value), I get coloured in red the upper cell instead of the correct one.

    Here the script, any help?

    Please Login or Register  to view this content.
    same issue also posted here:
    http://www.vbaexpress.com/forum/showthread.php?t=42478
    http://www.ozgrid.com/forum/showthread.php?t=166275
    Last edited by cerebrolele; 06-09-2012 at 12:50 PM.

  2. #2
    Registered User
    Join Date
    04-22-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VBA comparison spreadsheet

    Please do not multi-post.

    http://www.vbaexpress.com/forum/showthread.php?t=42478

    http://www.ozgrid.com/forum/showthread.php?t=166275

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: VBA comparison spreadsheet

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    06-09-2012
    Location
    london, england
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA comparison spreadsheet

    I apologize for the mistake.
    I am just tying to solve my issue providing more visibility to my post.

    My intention is, once I will find a solution, to link the solution in the different thread.
    This actually will also increase the possibility, for everybody with a similar issue, to easier retrieve the solution.

    I will update the first post including the links of cross-post.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: VBA comparison spreadsheet

    Maybe slightly missing the point...

    I believe your intention is true and honest, but when you cross post (and in this case at least three forum's) you have multiple people trying to solve the same issue diverting the attention from other members threads who have an issue they would like an answer too.

  6. #6
    Registered User
    Join Date
    06-09-2012
    Location
    london, england
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA comparison spreadsheet

    I found a funny solution!
    before running the script, it is just sufficient to select both ranges to be compared and find/replace any empty cell with a character (i.e. a slash).
    In this way there are no empty cells to compare and the bug does not occur at all! Easy and Fast!

    I apologize once more for any trouble I may have caused with my cross-posting and thank you to who had the courtesy to explain me, in a very polite way, why I was wrong (jeffreybrown).
    Thank you for nothing to those that just pointed me out as a forum-jackal.

  7. #7
    Registered User
    Join Date
    06-09-2012
    Location
    london, england
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA comparison spreadsheet

    just to complete the information, here a brief explanation of what the code does.
    it makes a comparison between two spreadsheet (different version of the same spreadsheet - layout should be the same and unique ID in the first column).
    Worksheet1 - old version
    Worksheet2 - new version

    then alt+f11 and run the script

    results:
    Worksheet3 - records (rows) with modification, with changed values in red
    Worksheet4 - records (rows) deleted in the new version
    Worksheet5 - records (rows) added in the new version

    Known bug:
    if a value changes from "data" to nothing (empty cell), the cell highlighted is the one above the actual one.
    So far I worked around this, replacing with a dash (or any other character) all empty cells both in old version and new version.

    Attached, a sample of the file with the script
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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