![]() |
Open next excel file in directory and stop when no more files list
I would like to invoke a macro to open the "first" EXCEL file in a directory
(and I don't care if "first" means by alpha name, first by date, etc.), copy the filtered data file contents to another file (file 2) and then close the first file, then open the next file in the directory and do the same (i.e. copy the filtered data file contents to file 2), and so. How do I specify the "first" file in the listing and then how do I specify "open the next file" and continue doing so until there are no more files which have been opened? Thanks. |
Open next excel file in directory and stop when no more files list
Hi Eric
See http://www.rondebruin.nl/copy3.htm Maybe you like the add-in http://www.rondebruin.nl/merge.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... I would like to invoke a macro to open the "first" EXCEL file in a directory (and I don't care if "first" means by alpha name, first by date, etc.), copy the filtered data file contents to another file (file 2) and then close the first file, then open the next file in the directory and do the same (i.e. copy the filtered data file contents to file 2), and so. How do I specify the "first" file in the listing and then how do I specify "open the next file" and continue doing so until there are no more files which have been opened? Thanks. |
Open next excel file in directory and stop when no more files
Ron,
The macro worked BUT FOR the fact that I received the error mesasge indicating that there weren't enough rows available in the new file. It would appear that the macro is going back and starting again from the beginning of the files listed in the directory and creating another listing of all the underlying files. Any ideas? "Ron de Bruin" wrote: Hi Eric See http://www.rondebruin.nl/copy3.htm Maybe you like the add-in http://www.rondebruin.nl/merge.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... I would like to invoke a macro to open the "first" EXCEL file in a directory (and I don't care if "first" means by alpha name, first by date, etc.), copy the filtered data file contents to another file (file 2) and then close the first file, then open the next file in the directory and do the same (i.e. copy the filtered data file contents to file 2), and so. How do I specify the "first" file in the listing and then how do I specify "open the next file" and continue doing so until there are no more files which have been opened? Thanks. |
Open next excel file in directory and stop when no more files
Hi Eric
With Ctrl End you can jump to the last cell on a worksheet Maybe there is something in a cell below your data that you not know. Always test with a few files in a folder first If you use the Add-in you can check the log file for the range -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... Ron, The macro worked BUT FOR the fact that I received the error mesasge indicating that there weren't enough rows available in the new file. It would appear that the macro is going back and starting again from the beginning of the files listed in the directory and creating another listing of all the underlying files. Any ideas? "Ron de Bruin" wrote: Hi Eric See http://www.rondebruin.nl/copy3.htm Maybe you like the add-in http://www.rondebruin.nl/merge.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... I would like to invoke a macro to open the "first" EXCEL file in a directory (and I don't care if "first" means by alpha name, first by date, etc.), copy the filtered data file contents to another file (file 2) and then close the first file, then open the next file in the directory and do the same (i.e. copy the filtered data file contents to file 2), and so. How do I specify the "first" file in the listing and then how do I specify "open the next file" and continue doing so until there are no more files which have been opened? Thanks. |
Open next excel file in directory and stop when no more files
Ron,
One more question... How do I copy just the "filtered rows" in the initial excel file rather than the whole file? These rows are then to be pasted into another file (one single file) one after another until all the filtered rows in each file in the sub-directory have been copied over. Thank you in advance. "Ron de Bruin" wrote: Hi Eric With Ctrl End you can jump to the last cell on a worksheet Maybe there is something in a cell below your data that you not know. Always test with a few files in a folder first If you use the Add-in you can check the log file for the range -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... Ron, The macro worked BUT FOR the fact that I received the error mesasge indicating that there weren't enough rows available in the new file. It would appear that the macro is going back and starting again from the beginning of the files listed in the directory and creating another listing of all the underlying files. Any ideas? "Ron de Bruin" wrote: Hi Eric See http://www.rondebruin.nl/copy3.htm Maybe you like the add-in http://www.rondebruin.nl/merge.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... I would like to invoke a macro to open the "first" EXCEL file in a directory (and I don't care if "first" means by alpha name, first by date, etc.), copy the filtered data file contents to another file (file 2) and then close the first file, then open the next file in the directory and do the same (i.e. copy the filtered data file contents to file 2), and so. How do I specify the "first" file in the listing and then how do I specify "open the next file" and continue doing so until there are no more files which have been opened? Thanks. |
Open next excel file in directory and stop when no more files
Hi Eric
There is a filter example on the copy3 page -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... Ron, One more question... How do I copy just the "filtered rows" in the initial excel file rather than the whole file? These rows are then to be pasted into another file (one single file) one after another until all the filtered rows in each file in the sub-directory have been copied over. Thank you in advance. "Ron de Bruin" wrote: Hi Eric With Ctrl End you can jump to the last cell on a worksheet Maybe there is something in a cell below your data that you not know. Always test with a few files in a folder first If you use the Add-in you can check the log file for the range -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... Ron, The macro worked BUT FOR the fact that I received the error mesasge indicating that there weren't enough rows available in the new file. It would appear that the macro is going back and starting again from the beginning of the files listed in the directory and creating another listing of all the underlying files. Any ideas? "Ron de Bruin" wrote: Hi Eric See http://www.rondebruin.nl/copy3.htm Maybe you like the add-in http://www.rondebruin.nl/merge.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Eric_G" wrote in message ... I would like to invoke a macro to open the "first" EXCEL file in a directory (and I don't care if "first" means by alpha name, first by date, etc.), copy the filtered data file contents to another file (file 2) and then close the first file, then open the next file in the directory and do the same (i.e. copy the filtered data file contents to file 2), and so. How do I specify the "first" file in the listing and then how do I specify "open the next file" and continue doing so until there are no more files which have been opened? Thanks. |
All times are GMT +1. The time now is 02:03 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com