Hi , I would like to copy the active sheet of my workbook into a closed workbook .
Eg when the user runs the macro it will copy the active sheet , open a specified workbook and copy it into this workbook leaving the workbook open .
I have tried the folowing code but it copies the active sheet in workbook it has opened , not the active sheet from the file that is already open.
Hope this makes sense
Eg when the user runs the macro it will copy the active sheet , open a specified workbook and copy it into this workbook leaving the workbook open .
I have tried the folowing code but it copies the active sheet in workbook it has opened , not the active sheet from the file that is already open.
Hope this makes sense
VBA Code:
Sub CpyShtToNewWB()
Application.ScreenUpdating = False
Set closedBook = Workbooks.Open("S:\Jim Todd\Testing_Recovered\RDC_Excel_testing\7099_TNsMaster.xlsm")
ActiveSheet.Copy Before:=closedBook.Sheets(4)
'closedBook.Close SaveChanges:=True
Application.ScreenUpdating = True
End Sub