Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to copy all spreadsheets into 1 spreadsheet

Hello.
I have a folder that has 300 excel spreadsheets in it. I take these 300
spreadsheets and combine them into 1 spreadsheet buy going to run"cmd"
prompt and then using dos commands to copy all 300 into 1 spreadsheet.

Is there a macro that will do this all for me so I don't have to everytime
go out to "cmd" prompt and type the dos commands?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro to copy all spreadsheets into 1 spreadsheet

You can find a example here that use Shell
http://www.rondebruin.nl/csv.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Hello.
I have a folder that has 300 excel spreadsheets in it. I take these 300
spreadsheets and combine them into 1 spreadsheet buy going to run"cmd"
prompt and then using dos commands to copy all 300 into 1 spreadsheet.

Is there a macro that will do this all for me so I don't have to everytime
go out to "cmd" prompt and type the dos commands?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to copy all spreadsheets into 1 spreadsheet

Thank you. Thank You.

Although I'm having trouble changing the code so that it will save it in a
different location other than My Documents. Can you help.

I really need to do somethign to pay you back. Your site is wonderful. Is
there anything I can do to support you?

"Ron de Bruin" wrote:

You can find a example here that use Shell
http://www.rondebruin.nl/csv.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Hello.
I have a folder that has 300 excel spreadsheets in it. I take these 300
spreadsheets and combine them into 1 spreadsheet buy going to run"cmd"
prompt and then using dos commands to copy all 300 into 1 spreadsheet.

Is there a macro that will do this all for me so I don't have to everytime
go out to "cmd" prompt and type the dos commands?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro to copy all spreadsheets into 1 spreadsheet

Hi Dtown

You can change
DefPath = Application.DefaultFilePath

To this for example

DefPath = "C:\Data"


I really need to do somethign to pay you back. Your site is wonderful. Is
there anything I can do to support you?


Making you happy is my paycheck
Have fun with Excel and enjoy all the good stuff in the newsgroups


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Thank you. Thank You.

Although I'm having trouble changing the code so that it will save it in a
different location other than My Documents. Can you help.

I really need to do somethign to pay you back. Your site is wonderful. Is
there anything I can do to support you?

"Ron de Bruin" wrote:

You can find a example here that use Shell
http://www.rondebruin.nl/csv.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Hello.
I have a folder that has 300 excel spreadsheets in it. I take these 300
spreadsheets and combine them into 1 spreadsheet buy going to run"cmd"
prompt and then using dos commands to copy all 300 into 1 spreadsheet.

Is there a macro that will do this all for me so I don't have to everytime
go out to "cmd" prompt and type the dos commands?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to copy all spreadsheets into 1 spreadsheet

Ron.
One more question if you don't mind?
Can I specify in the code to only copy specific files from the folder.
Right now the code copies all the .csv files in the folder I choose.

For example, can I specify to only copy the following files
*softwareinstalled.csv

Everything else is working fine. I appreciate your help.

"Ron de Bruin" wrote:

Hi Dtown

You can change
DefPath = Application.DefaultFilePath

To this for example

DefPath = "C:\Data"


I really need to do somethign to pay you back. Your site is wonderful. Is
there anything I can do to support you?


Making you happy is my paycheck
Have fun with Excel and enjoy all the good stuff in the newsgroups


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Thank you. Thank You.

Although I'm having trouble changing the code so that it will save it in a
different location other than My Documents. Can you help.

I really need to do somethign to pay you back. Your site is wonderful. Is
there anything I can do to support you?

"Ron de Bruin" wrote:

You can find a example here that use Shell
http://www.rondebruin.nl/csv.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Hello.
I have a folder that has 300 excel spreadsheets in it. I take these 300
spreadsheets and combine them into 1 spreadsheet buy going to run"cmd"
prompt and then using dos commands to copy all 300 into 1 spreadsheet.

Is there a macro that will do this all for me so I don't have to everytime
go out to "cmd" prompt and type the dos commands?








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro to copy all spreadsheets into 1 spreadsheet

Hi Dtown

Yes try it

Change this line
Print #1, "Copy " & Chr(34) & foldername & "*.csv" & Chr(34) & " " & TXTFileName

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Ron.
One more question if you don't mind?
Can I specify in the code to only copy specific files from the folder.
Right now the code copies all the .csv files in the folder I choose.

For example, can I specify to only copy the following files
*softwareinstalled.csv

Everything else is working fine. I appreciate your help.

"Ron de Bruin" wrote:

Hi Dtown

You can change
DefPath = Application.DefaultFilePath

To this for example

DefPath = "C:\Data"


I really need to do somethign to pay you back. Your site is wonderful. Is
there anything I can do to support you?


Making you happy is my paycheck
Have fun with Excel and enjoy all the good stuff in the newsgroups


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Thank you. Thank You.

Although I'm having trouble changing the code so that it will save it in a
different location other than My Documents. Can you help.

I really need to do somethign to pay you back. Your site is wonderful. Is
there anything I can do to support you?

"Ron de Bruin" wrote:

You can find a example here that use Shell
http://www.rondebruin.nl/csv.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dtown Dawg" wrote in message ...
Hello.
I have a folder that has 300 excel spreadsheets in it. I take these 300
spreadsheets and combine them into 1 spreadsheet buy going to run"cmd"
prompt and then using dos commands to copy all 300 into 1 spreadsheet.

Is there a macro that will do this all for me so I don't have to everytime
go out to "cmd" prompt and type the dos commands?








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i copy protected spreadsheet in a macro R Davis Excel Discussion (Misc queries) 1 July 23rd 09 03:44 PM
Macro to copy and append spreadsheet changes to new spreadsheet Journey Excel Discussion (Misc queries) 1 June 13th 08 04:33 PM
How to copy the same formulas in a spreadsheet -Macro? klafert Excel Worksheet Functions 3 May 9th 07 10:10 PM
Macro to copy 2 columns to new spreadsheet each new day Joan[_3_] Excel Programming 1 December 19th 05 02:44 AM
Link multiple spreadsheets to one central spreadsheet using a macro Amanda[_5_] Excel Programming 1 August 18th 04 09:59 PM


All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"