+ Reply to Thread
Results 1 to 5 of 5

Text to columns

  1. #1
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Text to columns

    Hi,

    See attached file.

    I have in column A a set of dates with the format from "Microsoft Project" file. Some of these dates come with date ant time, but I only need the date.

    If I use the menus, "Text to columns" to convert, setting only 'comma:=True', everything works ok and I get the result I need in column D.

    I generated a macro and the code is this:

    Please Login or Register  to view this content.
    When I run the macro the result shown in column H is different from when it is done from the menus! Why?

    What can I do to get the result I need using a macro?


    Regards,
    Elio Fernandes
    Attached Files Attached Files
    Last edited by efernandes67; 12-26-2012 at 03:33 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Text to columns

    Elio

    What happens if you run this code?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Re: Text to columns

    Norie,

    I get the result of the cell A2 "41225,375". I didn't understand the reason ofyour question. Do you have anything in mind?

    Because my excel settings maybe differents than yours, I attached an image so that you can see the values.exf_Text_To Columns_picture.JPG

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    I was trying to see if somehow VBA was using different separators than you are.

    Doesn't look like it though.

    Why not try a different method to get the date?

    For example you could use the INT worksheet function.

    That will extract the integer part of the date/time, which is the date.
    Last edited by Norie; 12-20-2012 at 10:00 PM.

  5. #5
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Re: Text to columns

    Hi Norie,

    I tried to use the INT function but I did not ge the results I needed so I tried the TRUNK function and it is working.

    Thanks,
    Elio Fernandes

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1