+ Reply to Thread
Results 1 to 15 of 15

change event???

  1. #1
    Forum Contributor
    Join Date
    09-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    100

    change event???

    I have macro within a worksheet called bump ()

    what I want to do is automatically trigger the macro when cell A1 changes.

    essentially the number within cell A1 changes every second so I am happy to execute the macro every second.

    cheers

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: change event???

    What is causing this cell changes - may be it would be wise to use this as a trigger for bump macro?

    Otherwise - may be just:

    Please Login or Register  to view this content.
    would be enough.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    09-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: change event???

    my macro is called bump not my worksheet by the way...

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: change event???

    this Private Sub Worksheet_Change shall be in the worksheet code not in general module. (the worksheet which contains A1 cell which changes).

  5. #5
    Forum Contributor
    Join Date
    09-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: change event???

    sorry that doesn't work,,

    I have a countdown timer in cell A1 I basically want the macro to trigger every one second off that....

    if I alter the cell such as deleting the contents it runs the macro, but not when the countdown timer changes

  6. #6
    Forum Contributor
    Join Date
    09-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: change event???

    any help would be appreciated.........

  7. #7
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: change event???

    Try this...
    Hopefully this will do...
    Please Login or Register  to view this content.
    Paste the above code in Worksheet section, Not in General section.. (In the Dropdown above..)
    Regards,
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

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

    Re: change event???

    Hi, burdo77,

    essentially the number within cell A1 changes every second
    How is that done? Via Query? By VBA? What does your macro bump look like? What events are behind the sheet? Maybe post a sample workbook as attachemnt.

    @Vikas:
    I like Kaperīs approach better (looks more like the way I use to program) while both codes should work the same way.

    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

  9. #9
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: change event???

    Thanks for the opinion.. Holger..
    But when both will perform the same function how can one be better of other..?
    I am just asking for knowledge purpose..
    I have no problem in using Intersect approach...

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

    Re: change event???

    Hi, Vikas,

    maybe because your code should look like
    Please Login or Register  to view this content.
    Ciao,
    Holger

  11. #11
    Forum Contributor
    Join Date
    09-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: change event???

    -I have attached my sheet.
    -The countdown timer is produced via an API server which places it into cell A1 Sheet2. no VBA required for the countdown timer!!!!
    -If you make a simple macro button you will see what my macro does,
    -however I want that macro to work every second when the countdown timer ticks.
    -Bump macro is in Sheet2.

    cheers burdo
    Attached Files Attached Files

  12. #12
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: change event???

    1) intersect seems to be beter suited in general case because target coukd be column A or A1:C5 etc.

    2) we still know almost nothing about what really changes. You can try force excel to check periodically if something changed.
    For instance in ThisWorkbook module:
    Please Login or Register  to view this content.
    and in standard module (for instance Module1):
    Please Login or Register  to view this content.
    Save workbook, close and open it again to call OnTime storedtime, "MyBumpCaller" in Workbook_Open event handler.
    Then every second it will automatically check if current content of Sheet2!A1 is different than one stored in previous second. And if it is, it will call bump procedure in Sheet2 module (by the way - is it there for any purpose? Because typical location would be in standard module).

  13. #13
    Forum Contributor
    Join Date
    09-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: change event???

    I tried both code but still the same result... it didn't call my macro..

    I may of done it wrong so can u plz paste the code in the spreadsheet.. im a newbie at this so plz be patient

  14. #14
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: change event???

    I have some problems with forum access totay. One more modyfication - public variables
    Please Login or Register  to view this content.
    shall be declared in standard module.

    As requested - please see attachment with the code inserted.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    09-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    100

    Re: change event???

    hi kaper, it works a treat. Your generosity/time is greatly appreciated.

    Cheers burdo.

+ 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] change event AND calculate event on the same sheet
    By lauriejerome in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2013, 03:54 PM
  2. How to prevent SelectionChange event firing before Change event?
    By franklyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 05:17 AM
  3. Worksheet Change event ignore change event
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2011, 12:29 PM
  4. MsgBox in Enter event causes combobox not to run Change event
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2006, 10:55 AM
  5. [SOLVED] Worksheet Change Event-change event to trigger
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-18-2005, 06:05 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