As the title suggests, I am looking to pull two worksheets out of a workbook and make only those two sheets into their own workbook. Everything inside of the worksheets including all formulas and script will need to go with them, if that matters...
Call the sheets A and B
The tab titles of the sheets in the new workbook will not change, but the title of the workbook will be based on a variable in a cell in worksheet A
The workbook will also be saved on another computer on the network, on the desktop of a computer named "computer 2"
I poked around, but couldn't combine enough responses based on what I was looking for to come up with a working model.
Thanks in advance.
Perhaps something like this?
If you uploaded an example file you would probably get a better answer.Sub test() Sheets("A").Activate ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:="C:\SomeFolder\Whatever.xls" ActiveWorkbook.Close End Sub
Alf
file attached.
Thank you.
I got what I wanted with this. I still need to make some tweaks to it, but maybe someone can benefit from this.
Sub Make_New_Book() Dim DstFile As String 'Destination File Name Dim TD As String 'To date TD = Range("A2").Value Application.ScreenUpdating = False Application.DisplayAlerts = False Dim wb As Workbook Sheets(Array("A", "B")).Select Sheets("B").Activate Sheets(Array("A", "B")).Copy Set wb = ActiveWorkbook DstFile = Application.GetSaveAsFilename _ (InitialFileName:="C:\Documents and Settings\MyName\Desktop\Daily " & TD & ".xls", _ Title:="Save As") If DstFile = "False" Then MsgBox "File not Saved, Actions Cancelled." Exit Sub Else wb.SaveAs DstFile 'Save file wb.Close 'Close file End If MsgBox ("File Saved") Application.ScreenUpdating = True ActiveWorkbook.Save Application.DisplayAlerts = False Application.Quit End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks