Saving a single worksheet

S

SwedeMazi

Hi

I am working with a workbook with four diffrent
worksheets. Have tried to find out a way to save one
single worksheet in the workbook as a new excel file but
it seems imposible :(. Anybody can tell me how to do this?
 
R

Ron de Bruin

Try this for saving the activesheet as a new workbook in C:\

Sub test()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "C:\Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.Close False
End With
Application.ScreenUpdating = True
End Sub
 
A

Arvi Laanemets

Hi

Right-click on sheet's tab and select 'Move or Copy ...' from drop-down
menu. It's easy from there on.


Arvi Laanemets
 
S

Steved

Hello from Steved

I've tried this as set out below
SaveAs "C:\To Depots" & ThisWorkbook.Name _
& " " & strdate & "To Depots.xls"

I would like it to goto Folder C:\To Depots

but it puts it in C:\ please what do I need to add
to put the worksheet in C:\To Depots

Thankyou.


-----Original Message-----
Try this for saving the activesheet as a new workbook in C:\

Sub test()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "C:\Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.Close False
End With
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"SwedeMazi" <[email protected]> wrote
in message news:[email protected]...
 
R

Ron de Bruin

Hi Steved

you forgot a \

SaveAs "C:\To Depots\" & ThisWorkbook.Name _
& " " & strdate & "To Depots.xls"
 
Top