Question : VBA Convert long date format to short date

I need to create a macro, which converts a long date format to a short. Is that possible by using Format(stringxx, "YYYYMMdd") or is there another easy method?

Answer : VBA Convert long date format to short date

You don't really need to convert the date, you can change a string but a date is a date.

You can change with the format value if you start with a date

dim dtDate as date, strDate as string

dt=now()

strDate=format(dt,"YYYYMMDD")

or change the string to a string

strDate =format(dt, "DDD MMM, DD YYYY")

strdate=format(cdate(strdate),"YYYYMMDD")

Thomas
Random Solutions  
 
programming4us programming4us