+ Reply to Thread
Results 1 to 12 of 12

Need Help with Event Triggering when value changes

  1. #1
    Registered User
    Join Date
    07-10-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    15

    Need Help with Event Triggering when value changes

    Hi everyone,

    I have a problem writing a very simple vba.

    The idea i have is Excel Problem.png

    I want an event trigger that will calculate G3=G4/3 when i change G4 and the same trigger for G4=G3*3 when i change G3.

    Thanks guys!

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Need Help with Event Triggering when value changes

    Right click on the sheet tab and click view code.
    Copy the code and paste it into the blank window that comes up.
    If your workbook is not a .xlsm macro enabled workbook you will have to save it as one.

    Good Luck.

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Need Help with Event Triggering when value changes

    try this way:
    Please Login or Register  to view this content.
    LE:
    oh.. nevermind.. skywriter was faster!
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  4. #4
    Registered User
    Join Date
    07-10-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    15

    Re: Need Help with Event Triggering when value changes

    Thanks Guys!

    However,

    When i copy and paste the copy. It doesn't seem to work.

    Is it because of my merged cell?

  5. #5
    Registered User
    Join Date
    07-10-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    15

    Re: Need Help with Event Triggering when value changes

    I got the values to change, And because i have other cells uses this cell as an input, the value just keeps changing and runs into a loop

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need Help with Event Triggering when value changes

    Hi, calvinloo,

    any change in the codes supplied will trigger the event again as the other cell is changed.

    Maybe try:
    Please Login or Register  to view this content.
    And avoid using MergedCells as they will create more problems than they may be good (they are definitely not needed and should be abandonned from Excel ASAP in my opinion). You may try Centered above from the context menu instead.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  7. #7
    Registered User
    Join Date
    07-10-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    15

    Re: Need Help with Event Triggering when value changes

    Thanks HaHoBe,

    just one last thing. When i paste values into G3, G4 doesnt recalculate. Can that be fixed?

  8. #8
    Registered User
    Join Date
    07-10-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    15

    Re: Need Help with Event Triggering when value changes

    i mean when i goal seek the solution in G3, the new solution in G3 wont be taken?

  9. #9
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: Need Help with Event Triggering when value changes

    I apologize for putting you into the loop. I forgot about disabling events. I shouldn't stay up so late.

    Very kind of you to give me rep. points.
    Thanks.
    Good Luck.

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need Help with Event Triggering when value changes

    Hi, calvinloo,

    When i paste values into G3...
    I don´t have problems with pasting one cell as I don´t use MergedCells (which might be the reason for the code not working properly in your workbook).

    i mean when i goal seek the solution in G3, the new solution in G3 wont be taken?
    Correct me please but GoalSeek wasn´t mentioned before.

    Ciao,
    Holger

  11. #11
    Registered User
    Join Date
    07-10-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    15

    Re: Need Help with Event Triggering when value changes

    Yes, sorry i forgot to mention about goal seek into G3.

    Is there a way to fix it?

  12. #12
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need Help with Event Triggering when value changes

    Hi, calcinloo,

    as we do not know how your GoalSeek is set up it may be a good idea to attach a sample workbook in order for us to see how we may help.

    Ciao,
    Holger

+ 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. EVENT triggering?
    By EXLent in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-19-2014, 07:16 AM
  2. Event triggering
    By Sarimdesert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2014, 03:26 AM
  3. VBA Event triggering
    By teachMeExcel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2012, 02:12 PM
  4. ComboBox_Change Event Not Triggering
    By yay_excel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2011, 02:22 PM
  5. Triggering an event from a cell
    By krabople in forum Excel General
    Replies: 4
    Last Post: 12-08-2006, 04:27 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