+ Reply to Thread
Results 1 to 6 of 6

Check Date and Time in range and show Msgbox

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Check Date and Time in range and show Msgbox

    hi.
    Hi, how check date in column A and time in column B compare with system date and show msgbox?
    Date Time
    20/07/2016 09:00
    21/07/2016 09:00
    22/07/2016 09:37
    23/07/2016 09:38
    24/07/2016 09:00
    25/07/2016 09:00
    26/07/2016 09:46
    27/07/2016 09:00
    28/07/2016 09:55
    29/07/2016 09:00
    30/07/2016 09:00
    31/07/2016 09:00



    Please Login or Register  to view this content.
    Cross-Post
    http://www.mrexcel.com/forum/excel-q...ow-msgbox.html

    Thanks
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Check Date and Time in range and show Msgbox

    In words, you say you are looking for the date (which will find a match) but in code you are looking for a time (which probably won't match). To display the time for today's date from your table, just use

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Check Date and Time in range and show Msgbox

    After run your code, if i have same time and diferents day code not show nothing
    Data Tempo
    20/07/2016 09:00:00
    21/07/2016 09:00:00
    22/07/2016 09:37:00
    02/08/2016 17:45:00
    03/08/2016 17:45:00
    25/07/2016 09:00:00
    26/07/2016 09:46:00
    27/07/2016 09:00:00
    28/07/2016 09:55:00
    29/07/2016 09:00:00
    30/07/2016 09:00:00
    31/07/2016 09:00:00
    Why happening it?

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Check Date and Time in range and show Msgbox

    Try my file, attached - this picture is what I get when I run my amended macro:

    Capture.JPG
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Check Date and Time in range and show Msgbox

    But if not find date and not find time equal system date/time, not show nothing.
    do your teste.
    dd/MM/yyyy
    04/08/2016 and time 08:19, but in column B time is 08:10, show 04/08/2016 - 08:10, correct show exact time system

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Check Date and Time in range and show Msgbox

    I just don't understand what the values in column B are there for then....

    Please Login or Register  to view this content.

+ 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] Show sum value of range in msgbox
    By TimmerSuds in forum Excel General
    Replies: 5
    Last Post: 06-18-2014, 06:27 AM
  2. [SOLVED] Show All Data From Two Columns Matching Todays Date In A Msgbox
    By BigDawg15 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2013, 01:17 PM
  3. [SOLVED] How to show MsgBox if a range of cells in a worksheet of a workbook is already comp.
    By bigpappi23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 10:20 AM
  4. Check range if multiple names exist then show msgbox
    By c.pedersen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2012, 06:23 AM
  5. How to show MsgBox if a any cell value is > 17 in a range
    By syedalamgir in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2011, 08:48 PM
  6. Need a MsgBox if a Date in a Range is 30 Days Old
    By mrgillus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2009, 08:01 PM
  7. [SOLVED] MsgBox date & time
    By skippy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-22-2005, 04:06 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