+ Reply to Thread
Results 1 to 16 of 16

Macro - PopUp Box

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Macro - PopUp Box

    Say:
    A36 = 80

    I want to create a macro, that will inform me every time the cell 'A36' becomes smaller, or decreases in value... In the pop-up box I want it to say something like, '100m Test Required (20/10)'

    Please Help if you can!
    Leah

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Macro - PopUp Box

    If A36=80, why would it change?
    Is it a formula?

  3. #3
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    Yes Dave, there is a formula in this cell which calculates the running total of a range above it, and resets this number after it hits 100.. the formula is: A36==MOD(SUM(A2:A35),100)
    Please Help

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Macro - PopUp Box

    There is a three step macro (but simple) process...

    In the sheet that contains the code (assuming it is Sheet 1) put this code:

    Please Login or Register  to view this content.
    In a standard module, put this code:
    Please Login or Register  to view this content.
    In ThisWorkbook, put this code:
    Please Login or Register  to view this content.

    It simply does the following:

    1) When you open the workbook, the variable OldValue is assigned whatever the value of A36 is Sheet 1.
    2) When you make a change on Sheet 1, it will check the current value of A36 against OldValue. If OldValue is bigger this will trigger the messagebox.
    3) It will reassign the new value in A36 to OldValue.

    Let me know if you have any questions or changes.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    Can you please provide me with steps on how and where to enter each of the 3 codes? I am only new to macros.. It sounds as if it will work so thankyou very much however I do not want A36 to change to 'OldValue' I want the value to stay the same ...

    Leah

  6. #6
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    Spreadsheet.xlsxCould you please put the correct formulas in, and send the workbook back .. asap, this is rather urgent
    Thankyou for all your help!

  7. #7
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    never mind I got it all to work Thankyou so much!

  8. #8
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    One more question... I need this macro to be relevant not only for A36 but also the range of A36:N36, but with different messages, please help?

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Macro - PopUp Box

    Do you want it for each cell or any cell between A36 and N36?

  10. #10
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    For each cell, and also on numerous sheets :/

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Macro - PopUp Box

    OK... a different approach is called for. Here is the best option I could think of. I have now used a 14 X 6 array to track all the cells at one time. The new updated code is in the attachment and seems to be working fine. The same message comes up each time, but you can customize it per sheet. If you need help, let me know.

    abousetta

    P.S. This is now an old example, please new attachment in later post.
    Attached Files Attached Files
    Last edited by abousetta; 04-03-2012 at 08:33 AM. Reason: Outdated attachment. See example below for new one.

  12. #12
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Macro - PopUp Box

    Post deleted...

    New code in later post
    Last edited by abousetta; 04-03-2012 at 08:34 AM.

  13. #13
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    You have been a great help, thankyou Abousetta
    sorry for asking soo many questions but I was just wondering how I am meant to change the message for each separate cell (20/20) ( 25/20) etc. I understand how to change the message in the popup box for each separate sheet, just not for each cell :/

    Thankyou alot again!

  14. #14
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Macro - PopUp Box

    Hi,

    There a million and one ways to customize it so if you can tell me how you want the message box to customized I can see what I can do. I have updated all the code and added a unique message for each cell to tell you which cell on which sheet triggered the message box to display. Let me know if you need anything further.

    Good luck.

    abousetta
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    04-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro - PopUp Box

    Thankyou, Abousetta! You have solved the problem and been a wonderful help
    Much Appreciated,
    Leah

  16. #16
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Macro - PopUp Box

    Glad I could be of assistance and thanks for the feedback. If you are satisfied with the responses then please mark the thread as solved.

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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