+ Reply to Thread
Results 1 to 13 of 13

Error in macro for finding todays date

  1. #1
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Error in macro for finding todays date

    Please see the enclosed workbook.
    I have made a macro to ease finding todays date, but the respons is 'Date not found'.
    Could somebody look into the macro and find the error... ?
    Saturn
    Attached Files Attached Files
    Last edited by Saturn; 12-12-2011 at 03:06 PM.

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Error in macro for finding todays date

    try this way:

    Please Login or Register  to view this content.
    but better wilL be this:
    Please Login or Register  to view this content.
    Last edited by tom1977; 12-09-2011 at 10:40 AM.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Re: Error in macro for finding todays date

    Thanks tom1977

    It seems that the macro is cell-format-sencitive.
    Your macro works fine with the cell-format in the example, which is *14.03.2001 Norwegian (Bokmål).

    I still get the respons Date not found for this format: 14-Mar-2001 English (U.S.)

    How do I come around this problem ?

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Error in macro for finding todays date

    Please Login or Register  to view this content.



  5. #5
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Re: Error in macro for finding todays date

    ???
    Where is this code to be put in?
    Still not working.

  6. #6
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Re: Error in macro for finding todays date

    Still I have not find a solution to this problem.
    The original document is ammended with regard to the cell-format of the date-column.
    The Date format is 14-Mar-2001 English (U.S.)
    Still the error to the macro is Date not found

  7. #7
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Error in macro for finding todays date

    try to replace your code in GoToToday() with the snb's code.
    it works for me.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  8. #8
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Re: Error in macro for finding todays date

    Can you give me the entire code ?
    It doesn't work for me.

  9. #9
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Error in macro for finding todays date

    I used the same code
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Re: Error in macro for finding todays date

    This doesn't work for me.
    Could someone give me the entire code?

  11. #11
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Error in macro for finding todays date

    hi,
    try this and see if it helps you
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184

    Re: Error in macro for finding todays date

    This should work:
    Please Login or Register  to view this content.
    _______________________________________________
    Remember:

    Read the rules!

    Use code tags! Place [CODE] before the first line of code and [/CODE] after the last line of code.

    Mark your post [SOLVED] if it has been answered satisfactorily.
    To do this, click EDIT in your original post, click GO ADVANCED and set the PREFIX. It helps everybody!

    If you are approve (or disapprove) of any members response to your problem, please click the star icon underneath their post and comment. It matters.

  13. #13
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Re: Error in macro for finding todays date

    Thanks wamp
    Your code is working.
    I think this was a matter of problem with the cell formatting of the column containing the dates, and your sugesting is working.
    Also thanks to john55, but for this one I got the annoing ‘Date not find’.
    Saturn

+ 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