+ Reply to Thread
Results 1 to 3 of 3

Cell change to trigger Macro

  1. #1
    Sören_Marodören
    Guest

    Cell change to trigger Macro

    How can I trigger a Macro when the value in a cell is changed?
    Or can I have my macro triggd if any cell on my workshhet is changed?

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi Sören,

    Yes, with an event macro stored inthe module of the respective worksheet:
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$10" Then '<<<< change cell to suit your needs
    yourcode
    End Sub

    HTH
    Cheers
    Carim

  3. #3
    Sören_Marodören
    Guest

    Re: Cell change to trigger Macro

    Hi Carim,

    Thanks for the help.
    It works very good.

    I have also tested to skip the If-statment to get it to trigg on all type of
    changes in the worksheet. But it does not work so good.
    It hangs Excel at 100% CPU-load. So I skip that.

    BR,
    /Sören


    "Carim" wrote:

    >
    > Hi Sören,
    >
    > Yes, with an event macro stored inthe module of the respective
    > worksheet:
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Target.Address = "$A$10" Then '<<<< change cell to suit your
    > needs
    > yourcode
    > End Sub
    >
    > HTH
    > Cheers
    > Carim
    >
    >
    > --
    > Carim
    > ------------------------------------------------------------------------
    > Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
    > View this thread: http://www.excelforum.com/showthread...hreadid=531794
    >
    >


+ 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