PDA

View Full Version : How to enter date in immediate window for debugging purpose?



chunlee
03-30-2012, 11:36 AM
Hi! all,

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

Rick Rothstein
03-30-2012, 01:13 PM
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")

Excel Fox
03-31-2012, 10:46 PM
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#