+ Reply to Thread
Results 1 to 5 of 5

Need to reformat data imported from file

  1. #1
    Registered User
    Join Date
    10-04-2008
    Location
    Laval, Qc CANADA
    Posts
    34

    Need to reformat data imported from file

    - How do I use a loop to read a line until an empty cell or a given word?
    - What is the command for until end of file?

    Here is the detailed situation: I have a word file which contains data generated by a sampling equipment. However, while all the data is easily imported, the final result still needs sorting, mainly because one line of data gets to be on a few lines of text, which is resulting in a table where one row is actually the content of two or three rows...

    I know it could be done manually, but a few thousand readings definately makes it worth while to write a few lines of programming. While I know I can write a loop, I cannot simply base it on an amount of cells or lines because the original sampling device sometimes omits a few items.

    So the loop needs to read a line until an empty cell, cut and paste all following data on the next lines at the end of this line, and erase those lines once copied, then jump to the next.
    Last edited by anmck; 01-04-2011 at 12:52 PM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Need to reformat data imported from file

    anmck,

    What version of Excel are you using?

    Please attach your workbook or a sample workbook that accurately portrays your current workbook on one sheet, and what it should look like 'After' on another sheet. This makes it much easier to see exactly what you want to do, as well as shows us whether there is a consistent number of rows between tables and such.

    To attach your workbook (or a sample if sensative information) scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    10-04-2008
    Location
    Laval, Qc CANADA
    Posts
    34

    Re: Need to reformat data imported from file

    I am using Excel 2010. See attached document: the first sheet shows how it is, and the second how it should appear. I also added a 97-2003 version for those with previous versions of Excel.
    Attached Files Attached Files
    Last edited by anmck; 01-03-2011 at 03:52 PM.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Need to reformat data imported from file

    anmck,

    Detach/open workbook anmck - EF758559 - SDG13.xlsm and run macro ReorgData.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-04-2008
    Location
    Laval, Qc CANADA
    Posts
    34

    Re: Need to reformat data imported from file

    Thanx a lot!

+ 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