Saving one sheet in a workbook

JG71

Board Regular
Joined
Oct 31, 2002
Messages
107
Hello,
Is it possilble to have the information in a workbook save one or more sheets and not save others? Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
i guess no, unless you create a new workbook and copy the needed sheets to this new woorkbook via VBA
 
Upvote 0
Put the following macro in a standard module.

The macro saves sheet2 and sheet4 to the C:My DocumentsTemp directory. Change to suit (add more lines to the macro if you wish to save more sheets).<pre>
Sub CopySheets()

Dim NWB As Workbook ' New Workbook
Dim NewName As String
Dim OWB As Workbook ' Old WorkBook
Dim dPath As String
dPath = "C:My DocumentsTemp" 'Change to suit

Application.ScreenUpdating = False

NewName = ""
NewName = InputBox("Enter New Book Name without .xls")

Set OWB = ActiveWorkbook
Set NWB = Workbooks.Add

OWB.Sheets("Sheet2").Copy NWB.Sheets(1)
OWB.Sheets("Sheet4").Copy NWB.Sheets(1)


NWB.SaveAs FileName:=dPath & NewName + ".xls"
Application.ScreenUpdating = True

End Sub</pre>


HTH

Mike
This message was edited by Ekim on 2002-11-01 19:49
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,217
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top