+ Reply to Thread
Results 1 to 8 of 8

writing textfile to excel

  1. #1
    Forum Contributor
    Join Date
    03-09-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    173

    writing textfile to excel

    Hi

    I have a problem with my macro, sometimes it splits a number which is delimited with "." into two cells. For instance, 0.6888, becomes 0 in column A and 6888 in column B. Anyone who knows how to avvoid this problem? My excel uses comma normally as delimiting into decimals.

    Please Login or Register  to view this content.
    Last edited by Hjahren; 10-29-2010 at 06:56 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: writing textfile to excel

    Have you previously used either the import wizard or the Text to columns facility and specified '.' as a delimiter?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    03-09-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    173

    Re: writing textfile to excel

    No, the coding displayed earlier is the first part of importing into the excelsheet.

    I have also checked that the text to columns delimited with "." is unchecked on forehand

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: writing textfile to excel

    Well, since your macro doesn't actually put the data into Excel, it's not really relevant. I suspect the method you are using to Paste is responsible.

  5. #5
    Forum Contributor
    Join Date
    03-09-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    173

    Re: writing textfile to excel

    Do you have any idea to get rid of the problem?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: writing textfile to excel

    If it works sometimes, I would have to assume that you are doing something beforehand that involves parsing text.

  7. #7
    Forum Contributor
    Join Date
    03-09-2010
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2003
    Posts
    173

    Re: writing textfile to excel

    I don't do any parsing in this spreadsheet or this macro. But sometimes in other macros. But then comma delimited, and not dot delimited.

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: writing textfile to excel

    If you do parsing in the same Excel session (regardless of workbook) then it can affect subsequent pasting.

+ 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