Results 1 to 3 of 3

Thread: How to enter date in immediate window for debugging purpose?

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Red face How to enter date in immediate window for debugging purpose?

    Hi! all,

    How enter a date say "1/22/2012" in the immediate window to debug an UDF? Thanks in advance.:o

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    13
    Your question is kind of vague. If there is a variable that you want to have that date for test purposes, you would need to Break your program (assuming it did not issue a Break on its own due to an error) and then set that variable equal to that date, and then try continuing your program. For example, if your program is in Break mode and you want to set MyDate equal to 1/22/2012, you could do it either this way...

    MyDate = DateSerial(2012,1,22)

    or this way...

    MyDate = CDate("1/22/2012")

  3. #3
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Just taking a guess at what you intended to ask. If you want to test your UDF by passing a date argument, you could do this

    YOURUDF #1/22/2012#
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Replies: 5
    Last Post: 06-15-2013, 12:40 PM
  2. Debugging Techniques in VBA
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-23-2013, 07:27 AM
  3. Replies: 3
    Last Post: 05-17-2013, 01:22 PM
  4. Replies: 2
    Last Post: 10-05-2011, 04:18 PM
  5. VBA Code to Clear the Immediate Window.
    By technicalupload in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 09-02-2011, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •