Hi, I have these codes as a part of my project.

Dim xdate As Long
Dim queryX As Long

xdate = Format(CDate(textboxDate.Value), "mm/dd/yyyy")
queryX = Application.WorksheetFunction.CountIfs(ws.Range("H1:H50000"), xdate, ws.Range("B1:B50000"), comboCategory.Value, ws.Range("D1:D50000"), comboTerm.Value, ws.Range("E1:E50000"), textboxAmount.Value)
Basically, what I am trying to do is compare if a new record is a duplicate value. But when I try to run debug, CDATE can convert the textboxDate.value (say 3/31) to 3/31/2013 but xdate is 0. I need a way to extract the serial number of a date so I can compare it to range H1:H50000 which has the corresponding serial numbers of the previously entered records. I am not even sure if the other parts of the codes above are correct or would work, I just want to learn how to extract the serials. Please help.

TIA,
Steve