+ Reply to Thread
Results 1 to 3 of 3

Excel VBA: How to track changed cells

  1. #1
    Jens Lenge
    Guest

    Excel VBA: How to track changed cells

    Hello world,

    I'd like to have an Excel 2003 VBA macro be automatically called each time
    that the user changes the value of a cell (by either directly entering a new
    value of using copy/paste).

    * How can I make my macro be automatically called in such a case?
    * How can I detect which cells was changed from inside the macro?

    My macro should check the new cell value and change it under certain
    conditions. In case the cell value is changed by my macro, is there a way to
    prevent the macro from being called again for the same cell?

    Jens


  2. #2
    David McRitchie
    Guest

    Re: Excel VBA: How to track changed cells

    Hi Jens,
    Within a macro, you are in control and should program accordingly.

    For changes of constants (text or numbers) you can use a
    Worksheet Change Event, which can be selective as to which
    columns or rows you want to ignore or accept changes from.
    http://www.mvps.org/dmcritchie/excel/event.thm
    and inserting or deleting rows would be another matter.

    I don't think you will find recording changes very practical. The
    builtin Highlight Change is a major nuisance, for all but a few things
    like a final version (mignt be practical, but still a nuisance even for that purpose).
    Highlight, Change Highlighting
    http://www.mvps.org/dmcritchie/excel/highlite.htm
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "Jens Lenge" <[email protected]> wrote in message news:[email protected]...
    > Hello world,
    >
    > I'd like to have an Excel 2003 VBA macro be automatically called each time
    > that the user changes the value of a cell (by either directly entering a new
    > value of using copy/paste).
    >
    > * How can I make my macro be automatically called in such a case?
    > * How can I detect which cells was changed from inside the macro?
    >
    > My macro should check the new cell value and change it under certain
    > conditions. In case the cell value is changed by my macro, is there a way to
    > prevent the macro from being called again for the same cell?
    >
    > Jens
    >




  3. #3
    Jens Lenge
    Guest

    Re: Excel VBA: How to track changed cells

    I'll have a look.
    Thanks for your advice!

+ 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