View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Creating CSV for every Excel Tab

Sub Make_New_Books()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWorkbook.Worksheets
w.Copy
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path _
& "\" & w.Name, FileFormat:=xlCSV
ActiveWorkbook.Close
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Wed, 2 Jul 2008 14:37:02 -0700, LostInNY
wrote:

Hi all. I need a way to create a new CSV file for every Excel tab I have in
a workbook whenever a user saves the workbook. The workbook has tabs 1-20
and the data is from A1 to EP5000. When the workbook is updated and saved I
need to generate a new CSV that has the same name as the tab it originated
from. Any ideas?