Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Exporting multiple worksheets as CSV

I'm looking for a way to automatically export multiple worksheets as
CSV. I have some code that will export the Active Sheet. I'm not
looking for fancy renaming - I basically just need to turn each
worksheet in an XLS file into its own CSV file. Has anyone already
done this?

Thanks
Joe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Exporting multiple worksheets as CSV

I bet lots of people have a version that did what you asked. Here's one:

Option Explicit
Sub testme()

Dim newWks As Worksheet
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Copy 'to a new workbook
Set newWks = ActiveSheet
With newWks
.SaveAs Filename:="C:\temp\" & wks.Name, FileFormat:=xlCSV
.Parent.Close savechanges:=False
End With
Next wks

MsgBox "done with: " & ActiveWorkbook.Name

End Sub

Joe Sheehan wrote:

I'm looking for a way to automatically export multiple worksheets as
CSV. I have some code that will export the Active Sheet. I'm not
looking for fancy renaming - I basically just need to turn each
worksheet in an XLS file into its own CSV file. Has anyone already
done this?

Thanks
Joe


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Exporting multiple worksheets as CSV



I'm a complete newbie at this stuff...how would you edit this script so
it only exports a "target" sheet as a CSV?

So instead of multiples, it only exports one.

Thanks,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Exporting multiple worksheets as CSV



I'm a newbie at this...how would you change that script to make it work
if you wanted to "target" the sheet you wanted to export as CSV?

Basically, instead of multiple sheets, just the sheet you want.

Thanks!

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Problems printing/exporting multiple worksheets with Excel 2007 cwilder Excel Discussion (Misc queries) 0 April 14th 08 06:06 PM
Exporting multiple sheets to multiple htm files? [email protected] Excel Discussion (Misc queries) 4 April 2nd 05 01:26 PM
Exporting Access data to different worksheets on the same workbook chill[_2_] Excel Programming 1 December 5th 03 12:14 PM
Help exporting worksheets/data to a workbook. Tbird Excel Programming 2 October 22nd 03 07:18 PM
Exporting from multiple worksheets to single text file Chris Dunigan Excel Programming 3 September 16th 03 02:48 PM


All times are GMT +1. The time now is 03:45 AM.

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

About Us

"It's about Microsoft Excel"