Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this kind of format dates "02-01-2001 16:00" in a excel
spreadsheet (dd-mm-aaaa h:mm). In vb.net I have this code: Dim tempo As string tempo=oExcelWs.Cells(i, 1).Value and I get this date: tempo = "01-02-2001 16:00", the code have switched the month whit the day. Can anyone help me? Thanks Paulo Praça |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Dim tempo as String tempo = Format(oExcelWS.Cells(i,1).Value, "dd-mm-yyyy h:mm") Let me know if that works. Mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mark Bigelow wrote:
Try this: Dim tempo as String tempo = Format(oExcelWS.Cells(i,1).Value, "dd-mm-yyyy h:mm") Let me know if that works. Mark Thanks Mark, I solve my problem this way: dim time as DateTime Dim MyDateTime As String MyDateTime = time.ToString("dd-MM-yyyy h:mm") Paulo Praça |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding time in 24 hour format to produce hours in decimal format | Excel Worksheet Functions | |||
Need help with converting CUSTOM format/TEXT format to DATE format | Excel Worksheet Functions | |||
Replace million-billion number format to lakhs-crores format | Excel Discussion (Misc queries) | |||
how to format excel format to text format with separator "|" in s. | New Users to Excel | |||
Keep format after paste from other worksheets - conditional format or EnableControl solution doesn't work | Excel Programming |