Need a to automatically create a new excel from every sheet

B

benny

hi all

A customer sends us an excel file with over 20 sheets in it.
In order to upload it to our main server in need to manually create a
separate excel file from every sheet and name it by the name of the
sheet.
only then i can upload every excel to a separate table in the
database.
is there any way to do it automatically ?

thanks in advance

benny
 
G

Gord Dibben

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

'ActiveWorkbook.SaveAs FileName:="C:\yourfolder\" _
'& "\" & w.Name

ActiveWorkbook.Close
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top