![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 13
|
I have imported data that is formatted as General. I need it formatted as Date. The form is 20010207 whcih represents February 7, 2001. The Format, Cells option to format as a Date returns #############, etc.
I need to be able to convert/format to a Date type in VBA in order to do some calculations with the dates (for example, use one date and sort remainders for those within 60 days). This process will be done in VBA code. I cannot get the cell values recognized as Date types in any way. Any help would be appreciated. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
|
Highlight your column and try using text to columns under the data menu. When the wizard comes up, hit next, next again, then click on the date radio dial. Select YMD if your desired result is feb 7, or YDM if it is July 2. Finally hit finish. good luck
|
|
|
|
|
|
#3 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Try the following (been there):
Choose Text to Columns from the Data Menu When the Text Import Wizard appears click Next twice. Change the Column Data Format to date and choose your desired format from the drop down control. Choose Finish. Incidentally, you can record this in a macro... Cheers, Nate [ This Message was edited by: NateO on 2002-02-19 19:59 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|