Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Concat + dates
Hi,
I have a Cur Year ( a 4 digit number) a CurMonth (2 digit num) and a cell.Value (2digit day). I want to Concatonate these so I have day/month/year to do a date comparison with another date. This is what I have but I am getting a datatype error Set CurDate = (CStr(cell.Value) & "/" & CStr(CurMonth) & "/" & CStr(CurYear)) or Set CurDate = (cell.Value & "/" & CurMonth & "/" & CurYear) .... :( |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Concat + dates
This may help
curyear = "2003" curmonth = "05" mycell = Sheet1.Range("a3") CurDate = (mycell & "/" & curmonth & "/" & curyear) CurDate = Format(DateValue(CurDate), "dd/mmm/yyyy") Libby -----Original Message----- Hi, I have a Cur Year ( a 4 digit number) a CurMonth (2 digit num) and a cell.Value (2digit day). I want to Concatonate these so I have day/month/year to do a date comparison with another date. This is what I have but I am getting a datatype error Set CurDate = (CStr(cell.Value) & "/" & CStr(CurMonth) & "/" & CStr(CurYear)) or Set CurDate = (cell.Value & "/" & CurMonth & "/" & CurYear) .... :( . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Concat + dates
How about:
DateSerial(curYear,curMonth,cell.value) -- HTH, Dianne In , typed: Hi, I have a Cur Year ( a 4 digit number) a CurMonth (2 digit num) and a cell.Value (2digit day). I want to Concatonate these so I have day/month/year to do a date comparison with another date. This is what I have but I am getting a datatype error Set CurDate = (CStr(cell.Value) & "/" & CStr(CurMonth) & "/" & CStr(CurYear)) or Set CurDate = (cell.Value & "/" & CurMonth & "/" & CurYear) ... :( |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Concat + dates
Thanks guys,
DateSerial(a1,a2,a3) worked perfectly! -----Original Message----- How about: DateSerial(curYear,curMonth,cell.value) -- HTH, Dianne In , typed: Hi, I have a Cur Year ( a 4 digit number) a CurMonth (2 digit num) and a cell.Value (2digit day). I want to Concatonate these so I have day/month/year to do a date comparison with another date. This is what I have but I am getting a datatype error Set CurDate = (CStr(cell.Value) & "/" & CStr(CurMonth) & "/" & CStr(CurYear)) or Set CurDate = (cell.Value & "/" & CurMonth & "/" & CurYear) ... :( . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
concat rows | Excel Worksheet Functions | |||
Remove #VALUE! from ConCat Range Function | Excel Worksheet Functions | |||
howto: concat (x1:x3) | New Users to Excel | |||
Concat Macro help... | Excel Discussion (Misc queries) | |||
First letter of names, mi and last name concat, How? | Excel Discussion (Misc queries) |