Converting Data to Date Type from General Type
Converting Data to Date Type from General Type
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Converting Data to Date Type from General Type

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Denver, CO
    Posts
    1,743
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    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 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com