how to save current sheet

R

Raz

hi, is there any way to save only the current (working) sheet as .xls or
..xlsx skipping all the other sheets???

I know its possible to save as .csv and may be other formats which saves
only current sheet. is it possible to save as .xls or xlsx ????

thanks.
 
G

Gary''s Student

You could use a macro to delete all but the current sheet and then saveas a
new name:

Sub Macro1()
Dim s As Worksheet
For Each s In Worksheets
If s Is ActiveSheet Then
Else
s.Delete
End If
Next

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\jravensw\My Documents\newname.xls"
End Sub
 
R

Raz

thanks, but that wont work, becouse sometimes i need to save all sheets, and
sometime only one sheet.
Any other way to do it ??

currently i am saving the whole book and then deleting rest of the sheets.
which takes time.
 
G

Gord Dibben

Sub Make_New_Books()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWindow.SelectedSheets
w.Copy
With ActiveWorkbook
.SaveAs Filename:="C:\Gordstuff\" & w.Name & ".xls"
.Close
End With
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