Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default batch convert worksheets in one workbook into csv files?

Is there a way to batch convert many worksheets, contained in one workbook,
into individual csv files?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default batch convert worksheets in one workbook into csv files?

Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message ...
Is there a way to batch convert many worksheets, contained in one workbook, into individual csv files?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default batch convert worksheets in one workbook into csv files?

I adjusted the path to D:\CSVDATA
I get stuck on line starting: wks.copy

Can you give me a little more information? I'm rather new at this.

Thanks
"Ron de Bruin" wrote in message
...
Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message
...
Is there a way to batch convert many worksheets, contained in one
workbook, into individual csv files?

Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default batch convert worksheets in one workbook into csv files?

Do you have hidden worksheets in your workbook ?

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


"Robgrant" wrote in message ...
I adjusted the path to D:\CSVDATA
I get stuck on line starting: wks.copy

Can you give me a little more information? I'm rather new at this.

Thanks
"Ron de Bruin" wrote in message ...
Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message ...
Is there a way to batch convert many worksheets, contained in one workbook, into individual csv files?

Thanks








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default batch convert worksheets in one workbook into csv files?

Okay, how do I tell?

"Ron de Bruin" wrote in message
...
Do you have hidden worksheets in your workbook ?

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


"Robgrant" wrote in message
...
I adjusted the path to D:\CSVDATA
I get stuck on line starting: wks.copy

Can you give me a little more information? I'm rather new at this.

Thanks
"Ron de Bruin" wrote in message
...
Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message
...
Is there a way to batch convert many worksheets, contained in one
workbook, into individual csv files?

Thanks












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default batch convert worksheets in one workbook into csv files?

I clicked unhide for the workbook, but still get stuck at the same point in
the macro.
"Ron de Bruin" wrote in message
...
Do you have hidden worksheets in your workbook ?

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


"Robgrant" wrote in message
...
I adjusted the path to D:\CSVDATA
I get stuck on line starting: wks.copy

Can you give me a little more information? I'm rather new at this.

Thanks
"Ron de Bruin" wrote in message
...
Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message
...
Is there a way to batch convert many worksheets, contained in one
workbook, into individual csv files?

Thanks










  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default batch convert worksheets in one workbook into csv files?

Hi Rob

Okay, how do I tell?

FormatSheet...Unhide

Try this instead

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
If wks.Visible = -1 Then
wks.Copy 'copies to a new workbook
With ActiveSheet
.Parent.SaveAs Filename:="C:\Data\" & .Name, _
FileFormat:=xlCSV
.Parent.Close savechanges:=False
End With
End If
Next wks
End Sub



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


"Robgrant" wrote in message ...
I clicked unhide for the workbook, but still get stuck at the same point in the macro.
"Ron de Bruin" wrote in message ...
Do you have hidden worksheets in your workbook ?

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


"Robgrant" wrote in message ...
I adjusted the path to D:\CSVDATA
I get stuck on line starting: wks.copy

Can you give me a little more information? I'm rather new at this.

Thanks
"Ron de Bruin" wrote in message ...
Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message ...
Is there a way to batch convert many worksheets, contained in one workbook, into individual csv files?

Thanks












  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default batch convert worksheets in one workbook into csv files?

Very pretty, worked like a charm.
Thanks Ron.

"Ron de Bruin" wrote in message
...
Hi Rob

Okay, how do I tell?

FormatSheet...Unhide

Try this instead

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
If wks.Visible = -1 Then
wks.Copy 'copies to a new workbook
With ActiveSheet
.Parent.SaveAs Filename:="C:\Data\" & .Name, _
FileFormat:=xlCSV
.Parent.Close savechanges:=False
End With
End If
Next wks
End Sub



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


"Robgrant" wrote in message
...
I clicked unhide for the workbook, but still get stuck at the same point
in the macro.
"Ron de Bruin" wrote in message
...
Do you have hidden worksheets in your workbook ?

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


"Robgrant" wrote in message
...
I adjusted the path to D:\CSVDATA
I get stuck on line starting: wks.copy

Can you give me a little more information? I'm rather new at this.

Thanks
"Ron de Bruin" wrote in message
...
Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message
...
Is there a way to batch convert many worksheets, contained in one
workbook, into individual csv files?

Thanks














  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default batch convert worksheets in one workbook into csv files?

You are welcome


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


"Robgrant" wrote in message ...
Very pretty, worked like a charm.
Thanks Ron.

"Ron de Bruin" wrote in message ...
Hi Rob

Okay, how do I tell?

FormatSheet...Unhide

Try this instead

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
If wks.Visible = -1 Then
wks.Copy 'copies to a new workbook
With ActiveSheet
.Parent.SaveAs Filename:="C:\Data\" & .Name, _
FileFormat:=xlCSV
.Parent.Close savechanges:=False
End With
End If
Next wks
End Sub



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


"Robgrant" wrote in message ...
I clicked unhide for the workbook, but still get stuck at the same point in the macro.
"Ron de Bruin" wrote in message ...
Do you have hidden worksheets in your workbook ?

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


"Robgrant" wrote in message ...
I adjusted the path to D:\CSVDATA
I get stuck on line starting: wks.copy

Can you give me a little more information? I'm rather new at this.

Thanks
"Ron de Bruin" wrote in message ...
Hi Robgrant

Try this

You can save every sheet then as a CSV file with a loop
Dave Peterson posted this macro to save each sheet as a CSV

Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet

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

End Sub

(adjust the path)



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


"Robgrant" wrote in message ...
Is there a way to batch convert many worksheets, contained in one workbook, into individual csv files?

Thanks
















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 can I batch convert old excel 95/97/200/xp files to excel2003 LarryG Excel Discussion (Misc queries) 2 August 13th 09 08:43 PM
How can I batch convert 97-2003 .xls files to 2007 .xlsx files Dave Nuttall Excel Discussion (Misc queries) 4 August 3rd 09 11:38 PM
Batch Convert 2007 Excel files to 2003 format Pman Excel Discussion (Misc queries) 0 May 29th 08 05:58 PM
Batch renaming of many worksheets in Excel files? Lumen S Excel Discussion (Misc queries) 2 August 17th 06 09:48 PM
Convert excel worksheets into new workbooks (new files) G Setting up and Configuration of Excel 2 November 17th 05 03:19 PM


All times are GMT +1. The time now is 10:12 PM.

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"