+ Reply to Thread
Results 1 to 24 of 24

Excel Macro Pop-Up Reminder

  1. #1
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Question Excel Macro Pop-Up Reminder

    Hello

    Ok, I think I finally understand how to word this so it's understood as to what I need the macro to do. JLGWhiz had written this macro for me and it's close to working as I need it to. Now that I have a clear understanding of what I need, I am asking for help in getting an excel macro written using the information that follows below the code.

    Please Login or Register  to view this content.
    For Sheet A:

    I need the macro to pull the:
    - Course name from Column AV, Range AV19:AV50
    - Look for a completion date in Column AZ, Range AZ19:AZ50 - If there is NO data in the cell, the macro should
    - Look for the Due Date in Column BC, Range BC19:BC50

    If the Due Date is within 10 Business days and there's no data in the completion date for that course, the macro should pop-up a reminder telling the person looking at Sheet A that they have a course due in 10 days.

    This should happen again when the Due Date is within 5 business days.

    When the due date arrives, if there is no completion date entered, the pop-up should tell the person that the course is due by the end of the day.

    Please Note: I need to be able to change only the Sheet being referenced as I need this for each sheet A-Z. All the other information is the exact same in the sheets. Also, I only want the pop-up to appear when someone activates their sheet. For example, I activate sheet H, I don't have any courses due so I shouldn't see any pop-up. But if I activate Sheet M and there is/are courses due, then when I activate sheet M, the pop-up should appear.

    Please tell me this makes sense now.

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Excel Macro Pop-Up Reminder

    MydnyteSyn,

    Be much easier if you can kindly attach the workbook (use dummy data if the "real" values are sensitive)?

    Ochimus

  3. #3
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    Let's try it again. The objective and data are much clearer in this post. Paste this into the ThisWorkbook code module. It will only execute on sheets with a single alpha character for a name, provided the name in the sheet name tab has no leading or trailing spaces. There is no need to change anything in the code for it to work on a user's worksheet. As soon as a user activates their sheet, the code runs.

    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 12-21-2020 at 09:53 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  4. #4
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    Thank you! I'm getting a Run-time error '13': Type mismatch. When I click on Debug, it highlights the following line:

    Please Login or Register  to view this content.
    Is there something I need to change to fix this?

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    Please Login or Register  to view this content.
    You can try adding the string in red font to the statement as shown above. If that does not work, then post a sample of what the data looks like in column BC. Entries in column BC must be date data types for the code to work. Since we cannot see your worksheet, and no file is upladed to work with, the code can only be crafted based on what the user tells us in their posts.

  6. #6
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    Attachment 710001

    I've taken a snippet of how the sheet looks. I hope it uploaded correctly. When I added that code in red, it resulted in a Compile Error. In the snippet of the sheet, please note that where you see the DUE DATE in Column BC, that information is being pulled from a hidden sheet, which you can see in the Formula bar at the top.
    Attached Images Attached Images

  7. #7
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    Note that there is also an additional parenthesis ')' after the word Value.
    Please Login or Register  to view this content.
    But according to your screen shot, the CDate function should not be needed. Excel should automtically make everything in that column a date data type. The code ran without error on a test setup where column BC used the same date format and it produced the desired results. So as a last resort try changing the statement to

    Please Login or Register  to view this content.
    It might me leading or trailing spaces causing the problem.

  8. #8
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    Throw all the other stuff away and try this.

    Please Login or Register  to view this content.
    This should remove the spaces and convert the dates form text to date data types. When working with dates, we have to be sure that they are date data type instead of text. While they look like a date to the human eyeball, Excel has some built in quirks that change them with respect to what the computer sees. For instance, a space in front or after the the date entry automatically converts it to a text string. So when you attempt to do a math transaction with it, you get the Error 13, type mismatch. Best practice is just type in the date and let it line up on its on without any leading or trailing spaces. If the boss want a prettier set of data, then create a separate report for the boss from the finished data. But the database you use to calculate and manipulate data should be as clean as possible with minimal formatting if you intend to use VBA to manage the data.

  9. #9
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    Great, ok, thanks So I used the code you provided in your last post and the results are shown in the attachments. This is an employee's actual sheet so I blacked out sensitive data. Got a Run-time error mismatch 13. Is there something I need to do in the spreadsheet or perhaps there's something I'm missing?

    Snippet3.JPG

    Debug Info
    Snippet4.JPG

  10. #10
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    It is not seeing your date in column BC as a date and I cannot figure out why nor how to fix it without being able to access the worksheet. I am out of guesses so I will drop off the thread and maybe somebody else can figure it out and offer a solution.

  11. #11
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Excel Macro Pop-Up Reminder

    MydnyteSyn,

    If the Code isn't seeing BC as dates:
    Select any cell in Col BC containing a "Date" and then click the Comma in the Numbers tab and see what happens.
    If it IS a date, it will turn to a number (e.g. 44,189, which it today's date numerically).
    If it is Text that LOOKS like a date, it will simply stay in the same "date" appearance, so you need to convert the text to a number, then reset the Format as whatever date system, you want.
    If you want to convert using a formula, select a blank cell on the same row and type the formula =DATEVALUE (BC2), (assuming BC2 is the text data), and copy that down. Press Copy and Paste Special as a value, then replace Col BC with the new Column.
    If you want to use a Macro, try this:

    Please Login or Register  to view this content.
    (And if it is text you need to check any other columns using dates)

    Hope this helps

    Ochimus
    Last edited by Ochimus; 12-24-2020 at 01:38 PM.

  12. #12
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    Hi Ochimus and thank you I selected the first cell in the Due Date column and clicked the comma in and it changed, but when I looked at the ribbon bar, it said Accounting instead of Date. Do you think it's because I have the following entered so it pulls the dates from a hidden master sheet within the workbook?

    Please Login or Register  to view this content.

  13. #13
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    but when I looked at the ribbon bar, it said Accounting
    What did it show before you clicked the comma?

  14. #14
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    Quote Originally Posted by JLGWhiz View Post
    What did it show before you clicked the comma?
    It shows Date before clicking the comma.

  15. #15
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    Quote Originally Posted by MydnyteSyn View Post
    It shows Date before clicking the comma.
    Well, now I am stymied. If the data in BC is date data type then the code should not be throwing the Error 13. You need to upload your file so we can do a better analysis of the problem.

  16. #16
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    I removed everything I could to make the file acceptable while still keeping the sheets that are required. A few are hidden, but nothing is password protected so you can unhide and view what's needed. Thank you!
    Attached Files Attached Files

  17. #17
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Excel Macro Pop-Up Reminder

    First problem is when you open the Workbook, a Code runs automatically that 'activates' a sheet called "HOME".

    There is no such sheet in the workbook.

    What did you change the name to? Or did you simply delete the HOME sheet?

    Ochimus

  18. #18
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    I removed it. It has sensitive data and there's too much to just remove it so I got rid of the sheet. There's several other sheets I deleted in that copy, too.

  19. #19
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    No problem here with the removed sheets, but I am having some diffficulty with column BC on sheet A. Excel says it is data type date, but it has the characteristics of a string when tryimng to use it in code. I will have to do some research to figure out how to cure the anomally. Will post back when I have the solution. I don't understand why it changes its characterists as a value derived by formula, but it does.

  20. #20
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    This was working on your file that was uploaded, but try it again before you try to use it on the actual file.

    Please Login or Register  to view this content.
    Delete the old code then copy and paste this one into the ThisWorkbook code module.

    While Excel is saying that the range is formatted as Date data type, and the displayed valuie looks like a date, shen VBA tries to use that value, it does not automatically convert to a long integer value because it is a copy of a value from another sheet and the underlying value of the cell is a formula. So, VBA sees the value as a variant value or string. That means that the value has to be converted to something that vba will recognize as a valid date so it can do the math in checking the due dates against the current date. The DateSerial method provides the means to do that. CDate did not work in this case and I am still trying to understand why that did not work. But in any case, it shoiuld now do the math and produce your notices of courses due.

    This also seems to work OK on your file. I thought I had tried this earlier, but apparently not. It is more streamlined than the other, but you can choose which one to use.

    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 12-28-2020 at 08:27 PM.

  21. #21
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    Are you still there? Did either or both in post #20 work?

  22. #22
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    I'm here So I tried that second code you provided in the above post and it produced the same Run-time error 13 mis-match in it. When I clicked on the Debug, it didn't like this part of the code:

    Please Login or Register  to view this content.
    So I removed all of the code and tried it with the first one you provided. Seems to be working perfectly! Thank you so much!

  23. #23
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Excel Macro Pop-Up Reminder

    Quote Originally Posted by MydnyteSyn View Post
    I'm here So I tried that second code you provided in the above post and it produced the same Run-time error 13 mis-match in it. When I clicked on the Debug, it didn't like this part of the code:

    Please Login or Register  to view this content.
    So I removed all of the code and tried it with the first one you provided. Seems to be working perfectly! Thank you so much!
    Working with dates can be a real pain in the neck at times because of the way Excel treats them in differing conditions. So when we use them we need to make sure that they are seen as Date type and not Variant or String type. This was one I had not encountered before and it took me a while to figure out what was Not happening. Glad one of them worked for you.
    Regards, JLG
    Last edited by JLGWhiz; 01-08-2021 at 11:41 PM.

  24. #24
    Registered User
    Join Date
    12-26-2019
    Location
    Iowa
    MS-Off Ver
    2013 / 2016
    Posts
    47

    Re: Excel Macro Pop-Up Reminder

    Hello Again

    I've got a quick question regarding the code that was written for me for the Excel pop-up notice I needed. It's working perfectly, but I need to ask if it's possible for it to be altered slightly?

    In Column AU, Cell 17, I have the following entered:
    Please Login or Register  to view this content.
    - This is pulling the Hire/Start Date of the employee from a Master sheet. Many employees have the same hire date, but there are some who have a different hire date.

    We have Compliances we need to complete and they all have varying due dates. Currently, the macro works by looking for a Completion Date entered into Column AZ19:AZ50. If there is NOT a completion date entered, and the due date entered in Column BC19:BC50 is within X # of days, the popup will show for the employee and let them know what compliance(s) are coming due.

    Current Problem that needs to be resolved within the macro:
    There are some compliances whose due dates are strictly based on the Employees hire date.
    • Compliance 1 = Due every 2 yrs from the date of hire
    • Compliance 2 due every 3 yrs from the hire date
    • Etc

    Is there a way to add something to the macro that will take the hire date entered in Column AU17 and calculate when the next due date is based on X # of years in the future it needs?

    Hire date = 4-16-2019 - Compliance 1 is due every 2 years, beginning with the hire date. So next reminder needs to pop-up 4-9-2021 (7 days out), again on 4-14-2021 (2 days out), 4-16-2021 (due date)

    I hope this makes sense. Thank you in advance

+ 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. Need help with excel macro to create a pop-up reminder
    By MydnyteSyn in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-19-2020, 02:45 PM
  2. Error while sending reminder mails using macro
    By nachiket1985 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-06-2017, 08:39 AM
  3. [SOLVED] Macro modification - Trigger for pop up reminder
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2014, 08:10 PM
  4. Create Outlook Reminder on Excel and transfered to outlook by macro
    By Benjamin2008 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2013, 03:23 PM
  5. Running Excel Macro using Outlook reminder
    By kiran527 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2013, 04:16 AM
  6. Need help to create Excel macro for Outlook Reminder
    By Eric Boudreault in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2011, 11:10 AM
  7. Get excel macro to email reminder
    By kwik98 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-06-2011, 10:24 PM

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