+ Reply to Thread
Results 1 to 7 of 7

Open/Load TEXT file with Specific Date and start at specific Cell

  1. #1
    Registered User
    Join Date
    07-28-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    80

    Open/Load TEXT file with Specific Date and start at specific Cell

    Hi everyone,


    I have this excel file (please see attached "sample.xlsm") that monitors the number of transactions with an amount more than 50,000. The source file is a TEXT file with a filename of REP0607T.txt, where 06=Month 07=Day. I put all text file report together in a folder names by each year.

    I wanted to have a VBA code that when i click the command button, it open/load the file with the specified date and start it in CELL A20 (as shown in sample.xlsm).

    Thank you so much in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Open/Load TEXT file with Specific Date and start at specific Cell

    Please attach a sample TXT file. Thanks.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    07-28-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Open/Load TEXT file with Specific Date and start at specific Cell

    Quote Originally Posted by dflak View Post
    Please attach a sample TXT file. Thanks.
    herewith attached the TXT file..
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-28-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Open/Load TEXT file with Specific Date and start at specific Cell

    Hi everyone again,


    I've recorded a macro with this thread, and it works perfectly. Below is the Code:

    Please Login or Register  to view this content.
    But my problem is, every time i want to change the date for checking... i change also the code for the destination of TEXT file.

    So what is the code to replace the destination that base of the inputted date on cell A3?

  5. #5
    Registered User
    Join Date
    07-28-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    80

    Re: Open/Load TEXT file with Specific Date and start at specific Cell

    I solved it whith my own...

    Here's my code:
    Please Login or Register  to view this content.

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Open/Load TEXT file with Specific Date and start at specific Cell

    The macros you recorded work for June 7, 2017 only.

    I looked at the text file you included. There are 46 lines in the file, the first 12 of which are blank. It looks like you want the blank lines copied in.

    I will have something that will work for any date later today.

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Open/Load TEXT file with Specific Date and start at specific Cell

    Press Alt-F11 to open the macro editor. Double click on Module1.

    If you change the sheet name, you will have to change this line of code
    Please Login or Register  to view this content.
    You will have to change this line of code to show the path that contains the years as subdirectories:
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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] Open text file and store specific columns using arrays
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-23-2017, 02:45 PM
  2. [SOLVED] VBA to Find Specific Text, then Copy range to next open cell under specific text
    By Remotruker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2015, 10:59 AM
  3. [SOLVED] Open text file and copy specific rows into spreadsheet column
    By larsahl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2014, 07:02 AM
  4. Open other excel files with specific text in the file name
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2013, 04:45 AM
  5. Macro to copy specific line from text file and paste into specific cell in excel
    By keeneye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:35 AM
  6. Replies: 1
    Last Post: 06-22-2012, 02:18 PM
  7. Open text file to specific workbook
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2011, 05:44 PM

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