Import text files to Excel in given order

  • Hello everyone,


    I'm trying to make an upgrade to my code, but I have no idea how to do this with other dependencies to this code.
    The code now works like this:
    Choose Folder and in this folder grab all files with extension .par.
    Each imported .par file is on its own sheet and the name of the sheet is name of imported file. (Example: Name is Test.par and sheet name is the same - Test.par) Problem is with long names of the files.


    I need to be able to choose the order of the files (Like an array), just to click on them in order of importing to the sheets. (Sub process is using the order of sheets).


    Next problem is with the long names of files.

    • I need to import the name (for example) to Cell 1,1.
    • Another sub process is searching for cells on this sheets and I need to be able to refer to the name of the sheet.
      Example: I'm searching for cell value "Car", the process find the cell value "Car" on sheet "Toys" and I need to do something like this - FindedCell.Worksheet.Cells(1,1).Value
      The result of this should be, that FindedCell is on sheet "Toys".

    I tried to do the best description, which I could.:duck:


    Thank you a lot for every help! :)


    Here is code for import all .par files in folder:


    Here is code for creating new book with every .par files

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!