|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DateFormt To string format (Export To Excel)dim strPeriod as string = dtTransdate.ToString("dd-MMM-yyyy",
System.Globalization.DateTimeFormatInfo.InvariantInfo) '--excel code ..Range("H2").Value = strPeriod When I read the excel, the column show "Apr-06" , seems correct , however ( it is a date format column), I try to change into string format in excel but still fail. Then , I try to put "'" ..Range("H2").Value = "'" & strPeriod It is string format in Excel BUT when user do some sorting . (it change back into date format as shown as 01-Apr-2006 or 808354 (some strange integer) Please help Why not format the whole column as text?
Show quoteHide quote "Agnes" <ag***@dynamictech.com.hk> wrote in message news:uRW5giOaGHA.4036@TK2MSFTNGP04.phx.gbl... > dim strPeriod as string = dtTransdate.ToString("dd-MMM-yyyy", > System.Globalization.DateTimeFormatInfo.InvariantInfo) > > '--excel code > .Range("H2").Value = strPeriod > > When I read the excel, the column show "Apr-06" , seems correct , however > ( it is a date format column), I try to change into string format in excel > but still fail. > > Then , I try to put "'" > .Range("H2").Value = "'" & strPeriod > It is string format in Excel BUT when user do some sorting . (it change > back into date format as shown as 01-Apr-2006 or 808354 (some strange > integer) > > Please help > > > >
date calculations
Do loop memory consumption? "Send To Mail Recipient" Saving outlook email attachment? ListBox Control Classes and collections vs. virtual tables (datasets) Display All Domain Names on the Network Recursion with a Tree View and checkboxes GetType question Click-Once Deployment of DLLs |
|||||||||||||||||||||||