+ Reply to Thread
Results 1 to 15 of 15

Import txt Files into sheet based last month (name file)

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Import txt Files into sheet based last month (name file)

    Hi.
    All my files is in C:\Users\marreco\Downloads\
    All files has name formatt (yyyymmdd) -> 20140814
    I need import only last month files

    Every day a system plays text files within the (C: \ Users \ drake \ Downloads \) folder.

    eg
    I have to import only the files that have the name (yyyymmaa) based on last month
    Please Login or Register  to view this content.
    Last edited by marreco; 08-15-2014 at 10:10 AM.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Import txt Files into sheet based last month (name file)

    Please Login or Register  to view this content.

    not in excel at mo, so not tested.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Import txt Files into sheet based last month (name file)

    Hi.
    where I'll insert this piece of code?
    After ...
    Please Login or Register  to view this content.
    ?

  4. #4
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Import txt Files into sheet based last month (name file)

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Import txt Files into sheet based last month (name file)

    Soorry, nothing happening, myabe a do incorrect way

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Import txt Files into sheet based last month (name file)

    Try change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Import txt Files into sheet based last month (name file)

    always shows the message "No such file"

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Import txt Files into sheet based last month (name file)

    Then "no such file".

    Format$(DateAdd("m", -1, Date), "yyyymm") should return 201407 (current month -1) and the code should find the txt files which has "201407" somewhere in its file name.

  9. #9
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Import txt Files into sheet based last month (name file)

    hi my file has name 20140814 (yyyymmdd), i try change "yyyymmdd", but unsuccessfully

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Import txt Files into sheet based last month (name file)

    Quote Originally Posted by marreco View Post
    eg
    I have to import only the files that have the name (yyyymmaa) based on last month
    What does this mean?

  11. #11
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Import txt Files into sheet based last month (name file)

    Day by day in my folde(C:\Users\marreco\Downloads\), has multiples files (20140113, 20140208, 20140405, 20140814, 20140815).


    i need your brillhant code, get 20140814, 20140815 import to worksheet.
    Year-Month-Day
    2014-08----14

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Import txt Files into sheet based last month (name file)

    You are not answering to my question.

    Do you want current month or last month?

  13. #13
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Import txt Files into sheet based last month (name file)

    Sorry....
    i need current month!

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Import txt Files into sheet based last month (name file)

    Try change to
    Please Login or Register  to view this content.

  15. #15
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Import txt Files into sheet based last month (name file)

    Hi

    fascinating
    Very very good, thank you very much!!!!

+ 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. Import .xls files from subfolders into one file
    By anna mo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2014, 09:33 AM
  2. [SOLVED] open worksheet based on month to specific sheet named after month and hide rest
    By ianmcw in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2014, 10:19 PM
  3. Import multiple jpg files in one file with file name in next cell
    By samyell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2013, 07:58 AM
  4. File import - select file and import sheet(1) from closed workbook
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2011, 03:15 AM

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