+ Reply to Thread
Results 1 to 3 of 3

Execute Macro When Cells change

  1. #1
    Registered User
    Join Date
    12-12-2003
    Posts
    79

    Execute Macro When Cells change

    I would like to execute a macro i have when a cell changes , preferably this would be only if another cell was above zero

    so if cell B21 was above zero and changes were made to either Cell F3 or F4 then my macro CSVcreate would execute (This isnt the only time this macro will run though i also have it assigned to form buttons to run when needed)

    any help would be appreciated, thanks

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Execute Macro When Cells change

    You can use the Worksheet_Change event for this. Bring up the Sheet's Code page by double clicking the sheet in the Project Explorer (Usually on the left side of the VBE). Then click the left combobox above the Code section and change it to Worksheet. Then click the right combobox and change it to Change. Then paste the following so your code looks like this:

    Please Login or Register  to view this content.


    That should do it!
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    12-12-2003
    Posts
    79

    Re: Execute Macro When Cells change

    fantastic , works a treat !! many thanks

+ 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