+ Reply to Thread
Results 1 to 3 of 3

Debugging Date in Code

  1. #1
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Debugging Date in Code

    I am hoping one of you can help me out. For some reason, what I believe to be returning a date is returning the value 1.

    Some more input:

    - Cell E2 (which is J2.Offset(0, -5)) value is 3/31/2007 (real date, not text)

    - Variable myDay, which should return a serial date, is returning the value 1 as noted in the Immediate Window.

    Here is the relevant code:
    Please Login or Register  to view this content.
    Here is the code for the UDF "EndMonth":
    Please Login or Register  to view this content.

  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
    Hello Jasoncw,

    I corrected a few minor problems with code and it runs for me. You should double check it to make sure it working they way you intended.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Hi, Leith. Thanks so much for the help.

    Your code did help, but it did not resolve the problem I was encountering. The problem stemmed from declaring myDay as an Integer, rather than a Date. LOL! I knew it was going to be something stupid like that!

    Jason

+ 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