Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a Visual Basic 5.0 application that opens a recordset and then sends the output to an excel spreadsheet One of the fields in my recordset is a date/time datatype of short time When the excel object is created and I see the sheet appear the column for the this field looks like this 1/0/190 If i click into a cell in this column and look at the cell contents i see the correct full date time which is example: 04/19/04 6:30 A How do I format this column in my visual basic application using the excel object to show the short time once the excel sheet is created and visible I'm new to the excel sheet object model advice would be appreciated thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Chris;
Try this: Columns("A:A").NumberFormat = "m/d/yy h:mm AM/PM" Where the column is A. If you are using an automation object your code might look like this: MyAutomationObject.Application.Columns("A:A").Numb erFormat = "m/d/yy h:mm AM/PM" -----Original Message----- Hi, I have a Visual Basic 5.0 application that opens a recordset and then sends the output to an excel spreadsheet. One of the fields in my recordset is a date/time datatype of short time. When the excel object is created and I see the sheet appear the column for the this field looks like this: 1/0/1900 If i click into a cell in this column and look at the cell contents i see the correct full date time. which is example: 04/19/04 6:30 AM How do I format this column in my visual basic application using the excel object to show the short time once the excel sheet is created and visible? I'm new to the excel sheet object model. advice would be appreciated. thanks . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compare sheet 1 column A numbers with sheet 2 column A number | Excel Worksheet Functions | |||
Inserting an excel sheet without the formatting. | Excel Discussion (Misc queries) | |||
Formatting a excel sheet that has been created using DTS. | Excel Discussion (Misc queries) | |||
Maintaining column formatting when copying a row to another sheet based on a value | Excel Programming | |||
Formatting the default Excel sheet | Excel Programming |