+ Reply to Thread
Results 1 to 2 of 2

Looking for changes in data via comparison

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Looking for changes in data via comparison

    Hi,

    I am looking for the correct VBA coding to be able to compare if a change has been made to my worksheet. I need to be able to alert the user, when a particular macro is run, if any changes are evident. For example, I have listed a number of companies with associated values and I need to run a comparison when I run the macro with name (eg) CompanyAccounts. The coding just needs to be able to check whether any changes have been made to the companies or values, and alert the user if it has, when I run CompanyAccounts macro.

    Any help would be much appreciated
    Last edited by excelspud; 10-26-2011 at 09:57 AM.

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Looking for changes in data via comparison

    excelspud;

    VBA can only compare 2 values. It has no way of looking up what the old value used to be. So you need to decide how and where to store the old value BEFORE any one changes it.

    You could make a copy of the worksheet, then when the macro is runs it compares the current sheet with the copied sheet.

    Or you could have the workbook just make a note of what cells were ever changed and list the changes when the macro is run (it won't show the old value, just the address of changed values). Something like this:

    Please Login or Register  to view this content.
    Then your macro would do something like this:

    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

+ 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