Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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)


.... :(
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
concat rows nmpb Excel Worksheet Functions 4 January 15th 09 10:50 AM
Remove #VALUE! from ConCat Range Function Excel Helps Excel Worksheet Functions 5 January 23rd 08 01:37 PM
howto: concat (x1:x3) Marc Hebert New Users to Excel 3 December 15th 06 07:52 PM
Concat Macro help... [email protected] Excel Discussion (Misc queries) 4 August 8th 06 05:09 PM
First letter of names, mi and last name concat, How? Shadowofthedarkgod Excel Discussion (Misc queries) 3 June 1st 05 04:09 AM


All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"