#1   Report Post  
Michael MacLachlan
 
Posts: n/a
Default Export Areas

Is it possible to export certain areas from Sheets in a workbook
automatically to single .CSV Files with the name of the sheet ?
E.G.: The Range A:5 - Z:89 for the Sheets named Argentina, Austria,...
should produce .CSV Files named : Argentina.csv, Austria.csv ......

  #2   Report Post  
Vikrant Vaidya
 
Posts: n/a
Default

Start recording a macro and do it manually once. then next time just run that
macro. You will find record macros in ToolsMacro

"Michael MacLachlan" wrote:

Is it possible to export certain areas from Sheets in a workbook
automatically to single .CSV Files with the name of the sheet ?
E.G.: The Range A:5 - Z:89 for the Sheets named Argentina, Austria,...
should produce .CSV Files named : Argentina.csv, Austria.csv ......

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

How do you know which worksheets to copy?

If you can copy all the worksheets in the workbook, then you could use code
like:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim newWks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
'or use this for your selected sheets
'For Each wks In ActiveWindow.SelectedSheets
Set newWks = Workbooks.Add(1).Worksheets(1)
wks.Range("a5:z89").Copy _
Destination:=newWks.Range("a1")
With newWks
Application.DisplayAlerts = False
.Parent.SaveAs Filename:="C:\WINDOWS\TEMP\" & wks.Name, _
FileFormat:=xlCSV
Application.DisplayAlerts = True
.Parent.Close savechanges:=False
End With
Next wks

End Sub

If you have to ignore some of the worksheets, maybe you could group the sheets
(click on the first worksheet tab and ctrl-click on subsequent), then uncomment
the activewindow line and comment the activeworkbook line.

For Each wks In ActiveWorkbook.Worksheets
'or use this for your selected sheets
'For Each wks In ActiveWindow.SelectedSheets



Michael MacLachlan wrote:

Is it possible to export certain areas from Sheets in a workbook
automatically to single .CSV Files with the name of the sheet ?
E.G.: The Range A:5 - Z:89 for the Sheets named Argentina, Austria,...
should produce .CSV Files named : Argentina.csv, Austria.csv ......


--

Dave Peterson
  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

And don't forget to adjust the path to an existing folder.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Michael MacLachlan wrote:

Is it possible to export certain areas from Sheets in a workbook
automatically to single .CSV Files with the name of the sheet ?
E.G.: The Range A:5 - Z:89 for the Sheets named Argentina, Austria,...
should produce .CSV Files named : Argentina.csv, Austria.csv ......


--

Dave Peterson
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 set my Excel Chart to not show areas where I have no dat. AmyJ Charts and Charting in Excel 1 January 14th 05 09:45 PM
how do I export an Excel graph to an encapsulated postscript (.ep. Fred Charts and Charting in Excel 1 January 12th 05 03:43 AM
how do allow two charts with two different chart areas? Omar Charts and Charting in Excel 1 December 8th 04 01:05 PM
export chart - size problem Art Parra Charts and Charting in Excel 1 December 7th 04 01:58 AM
Chart appearance using "export" method Alex St-Pierre Charts and Charting in Excel 4 December 3rd 04 03:29 AM


All times are GMT +1. The time now is 03:51 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"