ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Worksheets (https://www.excelbanter.com/excel-programming/358037-copy-worksheets.html)

Jason Zischke

Copy Worksheets
 
Hi all,

I have a workbook that copys an array of sheets into a new workbook saves it
and closes it, and until now I've had no touble with it but I open it on
another computer however it won't let my function work, what seems to happen
is that it stops at copy command and won't go any further and doesn't even
come up with an error message of anything however manually if you select the
sheets and copy to new workbook it works. Below is my code, so if any one can
help me with this whether there is a setting that does this or something else
?

Sub Export()
'-- Select Pricing Sheets --
Sheets(Array("Pricing1", "Pricing2", "Pricing3", "Pricing4", _
"Pricing5", "Pricing6", "Pricing7", "Pricing8", _
"Pricing9", "Pricing10")).Select
Sheets("Pricing1").Activate
'-- Copy Pricing Sheets --
Sheets(Array("Pricing1", "Pricing2", "Pricing3", "Pricing4", _
"Pricing5", "Pricing6", "Pricing7", "Pricing8", _
"Pricing9", "Pricing10")).Copy
'-- Save Export --
FileSaveName = Application.GetSaveAsFilename(InitialFileName:="Pr icing -" &
Format(Date, "dd-mm-yyyy") & ".Pri", FileFilter:="Pricing Files (*.Pri),
*.Pri")
ActiveWorkbook.SaveAs Filename:=FileSaveName, FileFormat:=xlNormal,
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
CreateBackup:=False
ActiveWorkbook.Close
End Sub


Thanks in advance

Jason


All times are GMT +1. The time now is 05:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com