Autosave some sheets (not all)

N

nona

I've used the following commands to make a sheet appear automaticly int
a new workbook.
Private Sub CommandButton1_Click()
Save.Hide
Blad1.Copy
Opslaan.Show
End Sub

I use 6sheets of which 3 need to be saved. How can I mak
page1(=Blad1), page2(=blad2) and page3(=Blad3) appear in the same ne
workbook?


Thank
 
G

Gord Dibben

nona

Using the macro recorder I got this code. Adapt to suit.

Sub copytonew()
''Application.DisplayAlerts = False ''include this if want no alert
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy
ActiveWorkbook.SaveAs Filename:= _
"C:\program files\microsoft office\exceldata\mynewbook.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
''Application.DisplayAlerts = True
End Sub

Gord Dibben XL2002
 

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