+ Reply to Thread
Results 1 to 7 of 7

My Macro does not find a simple date in a calendar sheet

  1. #1
    Registered User
    Join Date
    08-19-2012
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    50

    Talking My Macro does not find a simple date in a calendar sheet

    Hello!
    The problem is simple: I click on a button and some data gets saved in the macro to be filled in the cells below the date. The date is to be found in the "Tagebuch" Sheet aka a calendar. But somehow it does not work, even though I have today's date in that sheet.
    Please Login or Register  to view this content.
    I always get my error box instead of the success prompt. Today's date (10.11.2013 number type set to "date") was in range("k90") of my "Tagebuch" sheet, which is clearly in the search cell range.

    Thanks for helping me!
    Taktiker
    Last edited by Taktiker; 11-11-2013 at 08:35 AM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: My Macro does not find a simple date in a calendar sheet

    Hello Taktiker,

    It will be easier to sort this problem out using your workbook. Can you post a copy of it?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-19-2012
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: My Macro does not find a simple date in a calendar sheet

    Okay. Here is the workbook. The macro is "Diätplaner_Tagebucheintrag". It is executed by clicking on the purple button tagebuch. It should insert some data in the cell with today's date that is formated red in the calendar section.
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: My Macro does not find a simple date in a calendar sheet

    Hello Taktiker,

    Here is the corrected search function. I know it is a pain to include all the find arguments but it needs to be done. The reason is most of the arguments retain their settings between calls. Since these arguments are system level and not VBA level, you can never be certain what searchs have been performed before yours.

    Whren looking for Dates, the argument LookIn should be set to xlFormulas instead of xlValues. Some date functions are volatile an are compute when called. These will be missed if the search is set only to xlValues. The other problem with matching dates is a Date has a time component also. Generally, you want to ignore the time portion in the search. This is accomplished by setting the LookAt argument to xlPart instead of xlWhole.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-19-2012
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: My Macro does not find a simple date in a calendar sheet

    Thank you very much. It works charmingly.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: My Macro does not find a simple date in a calendar sheet

    Hello Taktiker,

    I don't speak German and had to look this up. Hopefully, it is correct.

    Du bist willkommen!

  7. #7
    Registered User
    Join Date
    08-19-2012
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: My Macro does not find a simple date in a calendar sheet

    Hello and thank you
    Everything with "willkommen" ist related to invitations (greeting a new person). I guess you intended to say "you're welcome"? This is "Gerngeschehen" or "Bitteschön" in german .

+ 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] Cells.Find xlDate does not find first date in sheet unless date format is dd/mm/yyyy
    By AtTheControls in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-07-2013, 12:35 PM
  2. [SOLVED] VBA to find date in a row and write name that is associated with date to a calendar
    By jwright650 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2013, 09:18 AM
  3. [SOLVED] Find the date and copy the values from the colum of the date find and paste to other sheet
    By nizzcmzph in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-20-2013, 10:03 AM
  4. Replies: 0
    Last Post: 07-03-2012, 03:52 PM
  5. Simple Vba to find a date
    By Algeraist in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2008, 04:59 AM

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