• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Putting text files into an existing folder instead of a new one.

Lymm

Member
Hi, I have been using Ron de Bruins code (below)to convert multiple text files to excel sheets in a newly added workbook. What I would like to do is to be able to add the worksheets to an existing workbook if possible. Help with the code for this would be much appreciated, Thanks


http://dl.dropbox.com/u/20269099/GetTextFiles.xls
 
Assuming you are using the code from here:

http://www.rondebruin.nl/txtcsv.htm


You should change this line

[pre]
Code:
'Add workbook with one sheet
Set basebook = Workbooks.Add(xlWBATWorksheet)
to this

'Add workbook with one sheet
Set basebook = ActiveWorkbook
[/pre]
to have the sheets added to the currently active workbook.
 
Brilliant , thank you, works a charm. I had been trying to put in the workbook name and obiously not doing it quite right as it didnt work
 
Back
Top