+ Reply to Thread
Results 1 to 15 of 15

Display msgbox if todays date found in column a

  1. #1
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Display msgbox if todays date found in column a

    Hi

    I have the code below in my workbook open module and i want it to display a msgbox if Now is found in column A with format yyyy/mm/dd(typed in) but displays as dd mmm yyyy.
    The code runs but does nothing. Please help.
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    can this perhaps be taken a step further an change the msgbox to something like "you have x appointments for today" where x is te amount of times now is found in column a?

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Display msgbox if todays date found in column a

    Suggest that you provide a sample workbook. If the appointments have date and time, then I suspect that Find is not going to locate them based on just the date.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Cannot upload, working from my cellphone. Column a has only dates, I need to find how many times the current date is in column a and show in the msg box when the workbook opens

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Display msgbox if todays date found in column a

    Just use COUNTIF then, comparing today's date with the dates in the column. No loop necessary, should be a lot quicker.

    Please Login or Register  to view this content.

    Regards, TMS

  6. #6
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Work in my normal worksheet, but not in xlam even if I use "This1Workbook"

  7. #7
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Error it gives in xla is runtime error 1004
    Method range of object global failed

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Display msgbox if todays date found in column a

    Thanks for the rep.

    You will probably need to fully qualify the columns(1) with a workbook and worksheet reference.

    so, maybe something like:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Ok so now its showing the msgboox,but it returns 0 eventhough todays date is present in column a. Think its the formatting and tried
    Please Login or Register  to view this content.
    And
    Please Login or Register  to view this content.
    and nothing works
    Any ideas?

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Display msgbox if todays date found in column a

    Any ideas?
    No. Please post a sample workbook so I can see what you are working with. Maybe you need to specify the actual workbook name, rather than ActiveWorkbook or ThisWorkbook.

  11. #11
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Thanks for your help and patience so far tms, really appreciate it.
    I'll see if I can get a exaple loade tomorrow.
    Have a great evening.

  12. #12
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Hi tms
    I got it to work!!!
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Hi tms
    I got it to work!!!
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Display msgbox if todays date found in column a

    Don't know if this is the best or even correct way of doing it, but it works, so...
    Thanks again for all your help tms, really appreciate it.

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Display msgbox if todays date found in column a

    Sometimes, if it works, it works ... don't worry about it

+ 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. search todays date from column if true display row *RESOLVED*
    By Nickrudd in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-13-2015, 09:58 AM
  2. [SOLVED] Match if not found, IsError, then display msgBox
    By Templemind in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2014, 09:57 AM
  3. lookup unique value in column A then display todays date eight columns across ??
    By michaelproctor001 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2013, 11:14 AM
  4. Auto Fill Todays Date In Column K in Last Value Found in Column A
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2013, 02:42 PM
  5. [SOLVED] msgbox if todays date is past date in cell
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2012, 07:08 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