+ Reply to Thread
Results 1 to 3 of 3

Open text file to specific workbook

  1. #1
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Open text file to specific workbook

    Hi there, I have the following code that I have recorded that basically opens a text file called UserTrace, applies a few few filters, copies to another sheet, deletes the original sheet and then opens a new text file called ORDPRODS.

    Please Login or Register  to view this content.
    The problem is when the 2nd text file opens it in opens in a new workbook called "ORDPRODS". Where I want the data to be is in sheet2 of "UserTrace" so I can easily perform various VLOOKUP's (I also have to do the same with another text file later). Is there anything I can do to

    Please Login or Register  to view this content.
    to achieve this.
    Many thanks in advance for any suggestions
    Last edited by WasWodge; 03-22-2011 at 05:44 PM.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Open text file to specific workbook

    Assuming that the code presents the data in the format you want, albeit, in a sheet in a new workbook, I'd be inclined to bow to the inevitable ... take the ActiveSheet in the ActiveWorkbook and copy it to ThisWorkbook, that is the workbook with the code in it.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Open text file to specific workbook

    TM, thanks for your reply. I was hoping to avoid a few steps and sending the code from one workbook to another (Wishful thinking!!!!!). Ah well back to putting in more code.............
    Solved

+ 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