Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to save 3 different ranges to a new workbook in 3 different
sheets. This is what I have so far: Private Sub CommandButton5_Click() Dim RecoC2Print As Range Set RecoC2Print = Worksheets("RecoC2").Range("A1.Y550") RecoC2Print.Copy Dim Myfile As Variant Myfile = Sheet17.Cells(31, 6) Set Myfile = Workbooks.Add Myfile.SaveAs "Planfile.xls" 'ACTUALLY WOULD LIKE THIS TO BE THE PATH IN MYFILE ABOVE 'Workbooks(Myfile).Activate Tried this didn't seems to work 'Application.SheetsInNewWorkbook = 3 'ThisWorkbook.Activate 'Sheet1.Activate Worksheets.Add.Name = "RecoC2" RecoC2.Range("A1:Y550").PasteSpecial Paste:=xlPasteValues ActiveWorkbook.SaveAs Myfile 'Sheets(Array(Sheet30, Sheet4, Sheet35)).PrintOut PrToFileName:=plan.xls End Sub I am having a problem getting the new workbook to be the active one. Thanks in advance for any help. Adella |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save a Range on a Workbook as a CSV File | Excel Discussion (Misc queries) | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Help on Workbook close and workbook save events | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |