I am trying to copy a worksheet to a new workbook and change the formatting. But the macro only changes the formatting on the original workbook. How do I gain focus on the new workbook?
Sub Copy_WorkSheet()
'open and copy sheet to new wb
Sheets("Sheet 1").Select
ActiveSheet.UnProTect
Sheets("Sheet 1").Copy
'change table style
ActiveSheet.ListObjects("VendComplete").TableStyle = "TableStyleMedium4"
'remove hidden hyperlink
ActiveSheet.Shapes.Range(Array("Picture 1")).Select
Selection.Cut
'close original wb
Windows("Supplier List_working.xlsm").Activate
Application.ThisWorkbook.Saved = True
ActiveWorkbook.Close
End Sub
Sub Copy_WorkSheet()
'open and copy sheet to new wb
Sheets("Sheet 1").Select
ActiveSheet.UnProTect
Sheets("Sheet 1").Copy
'change table style
ActiveSheet.ListObjects("VendComplete").TableStyle = "TableStyleMedium4"
'remove hidden hyperlink
ActiveSheet.Shapes.Range(Array("Picture 1")).Select
Selection.Cut
'close original wb
Windows("Supplier List_working.xlsm").Activate
Application.ThisWorkbook.Saved = True
ActiveWorkbook.Close
End Sub