+ Reply to Thread
Results 1 to 6 of 6

Trigger macro on cell change

  1. #1
    Registered User
    Join Date
    06-01-2015
    Location
    Derby, England
    MS-Off Ver
    2013
    Posts
    87

    Trigger macro on cell change

    It's late and I'm struggling to spot my error when trying to trigger a macro on a cell change.

    I want to run a Macro called GraphScale when a cell value S79 is changed.

    The cell value is changed via a combo box form control which is on the same worksheet as the macro and the target cell although the reference for the lookup is on another sheet.

    My macro GraphScale does work but the macro to trigger it doesn't

    So written as a private sub on the same worksheet as the form control and the target cell is
    Please Login or Register  to view this content.
    Any clues why this doesn't trigger?

    Any and all help appreciated.

    Ed

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Trigger macro on cell change

    I am pretty sure a combo box form control change is not going to trigger a worksheet change event. A data validation list would. And you would need to alter the line

    Please Login or Register  to view this content.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Trigger macro on cell change

    Instead of a change event, you could invoke the AfterUpdate property of the combobox.

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  4. #4
    Registered User
    Join Date
    06-01-2015
    Location
    Derby, England
    MS-Off Ver
    2013
    Posts
    87

    Re: Trigger macro on cell change

    daffodil11,

    Apologies if I'm being the dimmest of the dim but I've replaced my private sub code with yours and no cigar. I tried naming my form control combobox to see if that did anything but again no luck.

    I'm pretty new to all this, am I doing something daft?

    Massively appreciate the help by the way.

    Ed

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Trigger macro on cell change

    daffodil's code isn't applicable to a form control. You could utilize the _change event of a ActiveX control which would only require you to use a different type of combobox. You could also just directly assign your Graphscale macro to your form control combobox which would trigger upon a change in value of the form control combobox.

  6. #6
    Registered User
    Join Date
    06-01-2015
    Location
    Derby, England
    MS-Off Ver
    2013
    Posts
    87

    Re: Trigger macro on cell change

    "You could also just directly assign your Graphscale macro to your form control combobox"

    Did this, worked perfectly. Should have seen that myself but didn't.

    Thank you stnkynts

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro not trigger on cell value change
    By jeetusaini85 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 02-05-2015, 08:37 AM
  2. [SOLVED] macro won't auto trigger on cell change
    By rhodevans in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2013, 10:55 AM
  3. Change of value in a cell don't trigger macro
    By tuf82 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-01-2011, 09:50 AM
  4. [SOLVED] Trigger Macro on change in cell value
    By qwerty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-26-2006, 12:30 AM
  5. Cell change to trigger Macro
    By Sören_Marodören in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2006, 06:15 AM
  6. [SOLVED] Cell value change to trigger macro (worksheet change event?)
    By Neil Goldwasser in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2006, 10:00 AM
  7. [SOLVED] Cell Data Change to Trigger Macro
    By documike in forum Excel General
    Replies: 8
    Last Post: 01-06-2005, 03:06 PM

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