+ Reply to Thread
Results 1 to 9 of 9

text file to excel sheet problem(\s)

  1. #1
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    text file to excel sheet problem(\s)

    Hi to you all,
    Need macro to put the contents of text file in five columns (A-E) sheet, and sum 2nd column according to 3ed column (j&K)
    I started the coding but:
    1- The pattern I'm using works fine at the benign but in the end is messy couldn't sort it out.
    2- the result I get is 1 dimension array , so how to convert it to fill 5 columns ?
    Any way, the attached excel file may be clear, sheet 2 is the expected result and in sheet 1 is as far as I can get(messy at the end started in cell ("a1478")
    please help
    thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,141

    Re: text file to excel sheet problem(\s)

    This solution uses the PowerQuery add-in that is free to download here: https://www.microsoft.com/en-gb/down....aspx?id=39379

    Import the data into PQ and transpose, then use the following tutorial to pivot the data (in your case, the modulo setting will be 6, not 5): https://excelgorilla.com/power-bi/po...-using-modulo/

    Finally merge columns 3 and 4.

    In Excel, set the date column to show month and year using custom formatting.

    Note: the forum BB code does not like the Arabic, but it is correct in the attachment.

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    1
    0 1 Merged 4 5
    2
    7721
    45000
    1/????? ?????
    Apr-19
    5
    3
    395
    36000
    1/????? ?????
    Apr-19
    5
    4
    5436
    33600
    1/????? ?????
    Apr-19
    5
    5
    1998
    60000
    1/????? ?????
    Apr-19
    5
    6
    1525
    30000
    1/????? ?????
    Apr-19
    5
    7
    2468
    48000
    1/????? ?????
    Apr-19
    5
    8
    5480
    27000
    1/????? ?????
    Apr-19
    5
    9
    116
    18000
    1/????? ?????
    Apr-19
    5
    10
    8111
    18000
    1/????? ?????
    Apr-19
    5
    11
    7848
    12000
    1/????? ?????
    Apr-19
    5
    12
    7296
    12000
    1/????? ?????
    Apr-19
    5
    13
    5844
    6000
    1/????? ?????
    Apr-19
    5
    14
    1857
    6000
    1/????? ?????
    Apr-19
    5
    15
    3417
    60000
    1/????? ?????
    Apr-19
    5
    16
    1474
    22500
    1/????? ?????
    Apr-19
    5
    17
    7544
    21000
    1/????? ?????
    Apr-19
    5
    18
    5637
    21000
    1/????? ?????
    Apr-19
    5
    Sheet: Sheet1
    Attached Files Attached Files
    Last edited by AliGW; 08-03-2019 at 05:24 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: text file to excel sheet problem(\s)

    Hi AliGW,
    Thank you very much in deed
    but in your attachment if you stroll down to the end!!!
    not correct result!
    thank you again

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,141

    Re: text file to excel sheet problem(\s)

    Ah! Let's see what we can do about that ...

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,641

    Re: text file to excel sheet problem(\s)

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: text file to excel sheet problem(\s)

    Thank you AliGW

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,141

    Re: text file to excel sheet problem(\s)

    The problem is the space in some of the entries in the column 3 entries.

    Is there any chance of your getting the data in comma delimited format?

  8. #8
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: text file to excel sheet problem(\s)

    Mr. Jindon
    I Don't know what to say

    Thank you as much as possible
    In deed perfection As ever

  9. #9
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: text file to excel sheet problem(\s)

    Hi AliGW
    Thank you again
    Answer to you Q is not possible
    I get the text file from other party.

    Thank you for your effort

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Import from a text file to excel / problem with line break
    By ddblumenthal in forum Excel General
    Replies: 16
    Last Post: 05-24-2019, 01:53 PM
  2. Need to Read Text file and Paste required lines in different excel sheet based on Text
    By frazzlesole in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-05-2018, 08:34 PM
  3. Importing multiple .csv files into one new excel file - problem with sheet names
    By jts5814 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2016, 12:14 PM
  4. Replies: 1
    Last Post: 07-15-2013, 05:25 AM
  5. Problem with adding sheet to an excel file
    By endz0926 in forum Excel General
    Replies: 8
    Last Post: 09-02-2009, 12:29 AM
  6. [SOLVED] opening text file in excel problem
    By jz193 in forum Excel General
    Replies: 18
    Last Post: 02-10-2006, 10:45 AM
  7. Transposing text in text file to Excel Sheet.
    By sifar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2005, 07:05 AM

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