+ Reply to Thread
Results 1 to 1 of 1

VBA Extracting Specific Data from a Text File into Multiple Worksheets

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    ME, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    VBA Extracting Specific Data from a Text File into Multiple Worksheets

    Greetings,
    I'm a self-taught excel user who is lucky enough to peruse this forum. I have been able to piecemeal what I need for the most part for various projects but have come short on my current task.

    I am seeking help with code that will:
    Copy and Paste selected data from all .txt files in constant folder to specified worksheets and cells:
    • the Last Number from rows 1-5 = to last empty cell in row 5-9 of workbook
    • the Last Number from rows 6-8 = to last empty cell in row 10-12 of workbook
    • the Last Number from rows 9-11 = to last empty cell in row 13-15 of workbook

    ex. All .txt files in folder will look like this: sheet1.txt

    If interested, this is what I need the code for in my project, any help for the whole process is greatly appreciated :
    1. Loop through all .txt files from folder constant to active workbook Const conSpath As String = "C:\\data\"
    2. If ActiveSheet.Name="PA" Then selection = conSpath & "sheet1.txt" etc.
    3. Select & Copy the select data from .txt file
    4. Paste selection to next empty cell in row 5 of workbook Range("IV5").End(xlToLeft).Offset(0, 1).Select
      See workbook for clarification, see Grey cells in PA sheet: sheet1.xlsx


    Please let me know if this is possible, if not, I can rework the process.
    Last edited by csjung; 01-24-2013 at 12:55 PM. Reason: User error in defined process
    Many thanks and best regards,
    CJ

+ 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