Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Export multiple sheets to 1 csv file.
Does anyone have a function I could use to export multiple worksheets (each
contains around 65000 lines) into 1 CSV file? I have the following script which does a unique file for each worksheet, but I'm lousy with VB programming and hopeing someone out there already has a function or can help me edit this one. And ideally I want to miss out the first 2 sheets from the export. Thanks. ----------------------------- Option Explicit Sub mysaver() Dim counter As Integer counter = 1 ' counter is for the number of sheets in the workbook Do While counter <= Worksheets.Count ' Worksheets.Count represents the total number of sheets in the workbook On Error GoTo ErrorHandler ' go to the nominated sheet Worksheets(counter).Activate ' and save it. Simple... ActiveSheet.SaveAs Filename:=ActiveSheet.Name, FileFormat:=xlCSV counter = counter + 1 Loop MsgBox "All Sheets Saved.", , "Success" Exit Sub ErrorHandler: MsgBox "Error during save - Caution!", vbCritical, "Save Errors" Exit Sub End Sub ----------------------------- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
export sheets to multiple new files | Excel Discussion (Misc queries) | |||
export multiple sheets to multiple excel files | Excel Discussion (Misc queries) | |||
ExportAsFixedFormat for Multiple Sheets in a Single Excel File | Excel Worksheet Functions | |||
export re-order input fields to export file [csv] | Excel Worksheet Functions | |||
Lookup on multiple sheets in file | Excel Programming |