Sub CopyPasteIntoOtherWB()
Application.ScreenUpdating = False
Workbooks.Open Filename:="C:\File2.xls" 'Path to workbook to open and paste into
Sheets.Add.Name = "MyNewWorksheet" 'Temporary new worksheet name
ActiveCell.FormulaR1C1 = "=CONCATENATE(TEXT(NOW(),""[$-409]d-mmm-yy;@""))" 'Current Date
Selection.Copy
Selection.PasteSpecial (xlPasteValues)
Sheets("MyNewWorksheet").Name = Range("A1").Value 'Renaming new worksheet to current date
ActiveWorkbook.Save
ActiveWindow.Close
Selection.SpecialCells(xlCellTypeLastCell).Select 'Selecting everything on active worksheet
Range(Selection, Cells(1)).Select
Selection.Copy
Workbooks.Open Filename:="C:\File2.xls"
Selection.PasteSpecial (xlPasteFormats) 'Pasting Formats
Selection.PasteSpecial (xlPasteValues) 'Pasting Values
ActiveCell.Select
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
Range("A1").Select
End Sub
|