+ Reply to Thread
Results 1 to 11 of 11

Prompt message of time limit when time is entered

  1. #1
    Registered User
    Join Date
    07-28-2008
    Location
    United States
    Posts
    28

    Prompt message of time limit when time is entered

    Hi again,

    Is it possible to place a prompt message regarding the time limit or return time when entered time is place on the worksheet? Like "Please be back at 8:30 AM" when the user click the Start time button at 8:00 AM. I appreciate your assistance. Thanks

    Minato

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Add the following macro to your start button:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-28-2008
    Location
    United States
    Posts
    28
    whoa! that works perfectly Richard. Thanks a lot! I'm wondering if the same code applies when checking for the remaining time of the time limit. Like if the user's time limit is from 8:00 AM to 8:30 AM, if he came early than 8:30 say 8:15 and click the end button, a prompt message will display " You still have 15 minutes remaing. Do want to end?"

    Thanks,

    Minato

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    More or less. Name a spare cell "start'. This will hold the time that the start button is pressed. Then attach the macros below to the start and end buttons.

    Please Login or Register  to view this content.
    Rgds

  5. #5
    Registered User
    Join Date
    07-28-2008
    Location
    United States
    Posts
    28
    hi richard,

    I appreciate all of your assistance. I tried the last code you have given but unfortunately i got no luck with that. I have place the word START on one of the cells but once I click the start button there was no time being pasted but only displays the msg prompt of time limit. When I click the end button I am receiving the error message "Method 'Range' of 'object' Global Failed". Im sorry but im on the process of learning excel vba. I know im missing something here. Please enlighten me. Thanks

    minato

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Yes I think you misunderstood. I didn't mean you to enter the word 'start' in a cell, but that you give a name called 'start' to a cell. To name a cell you can either use Insert Name Define and enter the cell reference, or simply select a cell and type the word 'start' in the NAME box, which is on the Formula Bar just above the 'A' of column A on the sheet.

    I also realised my Time Left macro didn't cater for minutes where the start minute was before the hour and the end minute after the hour. Please use this modified code.

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Yes I think you misunderstood. I didn't mean you to enter the word 'start' in a cell, but that you give a name called 'start' to a cell. To name a cell you can either use Insert Name Define and enter the cell reference, or simply select a cell and type the word 'start' in the NAME box, which is on the Formula Bar just above the 'A' of column A on the sheet.

    I also realised my Time Left macro didn't cater for minutes where the start minute was before the hour and the end minute after the hour. Please use this modified code.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-28-2008
    Location
    United States
    Posts
    28
    hi richard,

    As expected your last code worked! I made some tweaking on the time left because it does not however paste the end time but looking through your previous example the start time, I was able to manage to have the end time pasted on another cell with end time name. Thanks! However, regarding the time left, how can I possibly have a yes or no button with the message box? Like "You still have 15 minutes remaing. Do want to end?" YES, NO. If I click Yes then the end time will be pasted but if I click NO then the end time will not be pasted unless I click the YES button. Again advance thanks to you!

    Minato

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Use this modified code. The cell containing the end time is named 'end'

    Please Login or Register  to view this content.
    Regards,

    Richard

  10. #10
    Registered User
    Join Date
    07-28-2008
    Location
    United States
    Posts
    28
    Hi richard,

    You're awesome man! Your last code worked perfectly! Thanks again. Just for last question, If I happened to want the start and end time be displayed on any of the cells, I will just be needing to change the range(reference) is that right? Because once I pulled up a data on my sheet like ID number and it matches the ID number on the sheet, the start and end time should be displayed along the row that matches the ID number. Thanks again.

    Minato

  11. #11
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi, not quite sure what you mean by changing the range reference, but I guess you could use something like:

    Please Login or Register  to view this content.
    where idrowcell is the A1 cell reference in the data row which contains the ID number, and $idsheet is the A1 cell reference containing the ID number on the sheet.

    and copy this down as appropriate, or have your data extract macro copy it down.



    Rgds

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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