+ Reply to Thread
Results 1 to 3 of 3

Look at text file, and produce a new result set based desired format in the excel

  1. #1
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London, England
    MS-Off Ver
    EXCEL 2013
    Posts
    324

    Look at text file, and produce a new result set based desired format in the excel

    Hey All
    I need some help

    Aim – Create a Macro, which looks at the text file called “Test” which will be located within the file pathway C:\Temp, and manipulate the data into the format which is on the excel spreadsheet

    I am hoping the example i have provided on the excel sheet, can give you a clear indication of the what i am trying to achieve

    I am really hoping you guys will be able to help

    Looking forward to your help

    Regards
    D
    Attached Files Attached Files
    Last edited by masond3; 12-11-2013 at 11:54 AM. Reason: Spelling Mistakes

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Look at text file, and produce a new result set based desired format in the excel

    I'm finding your attached examples confusing. Desired Results contains data that is not in the text file (the names, for example), and data that doesn't appear to come from consistant locations (Merchant # 878000046887, columns C, E, and F have 4, 2, and 4, but the text file looks like they should have 4, 2, and 1). Also, you haven't given an indication of your VBA experience. Responders will often provide simple code solutions, but in this case, it would probably be fairly extensive. I would suggest you start by recording the opening of the text file with fixed-length columns. It may take a few tries to get it as needed, since you will varying record formats for name, headings, and data. When you get that figured out, develop a routine that will have an outer loop for the merchants and an inner loop for the products. If you're completely lost, or just need some more guidance, let us know.

  3. #3
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Look at text file, and produce a new result set based desired format in the excel

    I'm thinking it might be a lot easier to actually do two fixed-length imports: One for the merchant number/name and one for the product data.

    This should get you down the road a ways. Rename your Sheet1 to "Results" (or a name of your choice -- just adjust the Constant in the code accordingly). Then paste the code into a code module and save the workbook as a .xlsm. You can run it to see how it works up to this point, then proceed from there. Let me know if you need any other direction. Blessings, and Merry Christmas!

    Please Login or Register  to view this content.
    Last edited by natefarm; 12-11-2013 at 02:20 PM. Reason: Added the code

+ 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. [SOLVED] Need help on VLookup to find result based on desired number
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2013, 08:54 PM
  2. Return desired result based on a condition (to show 0% instead of #div/0)
    By devilchild99 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-17-2012, 03:22 PM
  3. Return desired result based on a condition
    By devilchild99 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-17-2012, 01:00 PM
  4. Extracting text into desired format in Excel
    By mpendle in forum Excel General
    Replies: 6
    Last Post: 10-10-2009, 02:06 PM
  5. [SOLVED] How to produce comma-delimited and quoted text file from Excel?
    By Roger Kenner in forum Excel General
    Replies: 1
    Last Post: 09-15-2005, 03:05 PM

Tags for this Thread

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