LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Save range from one workbook to a new workbook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save a Range on a Workbook as a CSV File Connie Excel Discussion (Misc queries) 2 October 20th 06 03:42 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Help on Workbook close and workbook save events Adam Harding Excel Programming 1 September 29th 05 04:12 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Excel Programming 1 July 24th 03 11:37 PM


All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"