![]() |
Opening Text Files and Re-Saving Them
Hi.
I am trying to write some code which will allow a user to select a folder and then will open all of the text files in that folder and re-save them as excel files. I have sorted out the code to enable the user to select the folder they wish to use, but am looking some assistance on the looping to enable each of the text files to be opened and re-saved. Can anyone suggest how I might do this. Thanks. |
Opening Text Files and Re-Saving Them
If the text files are all the same, you could record a macro that Opens, saves
as an excel file, and closes the file. Then that recorded macro could be modified to open all the text files in the folder. If the files vary in format, then maybe you could have different macros for each type of text file. Ron de Bruin has some code for working with CSV files that may be a good starting point: http://www.rondebruin.nl/tips.htm (look for CSV) If you need help tweaking your code, post back with your code and the version of excel you're using--and the type of excel file you want to saveas. BoRed79 wrote: Hi. I am trying to write some code which will allow a user to select a folder and then will open all of the text files in that folder and re-save them as excel files. I have sorted out the code to enable the user to select the folder they wish to use, but am looking some assistance on the looping to enable each of the text files to be opened and re-saved. Can anyone suggest how I might do this. Thanks. -- Dave Peterson |
All times are GMT +1. The time now is 10:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com