I\'m trying to copy the contents of the active sheet to a new workbook.
Sub new_workbook()
Dim ExtBk As Workbook
Dim ExtFile As String
Columns(
I made it work:
Sub cp2NewWb()
Dim ExtFile As String
ExtFile = ThisWorkbook.Path & "output.xls"
Workbooks.Add.SaveAs Filename:="output.xls"
Windows("test1.xlsm").Activate
Range("A1:AA100").Copy
Windows("output.xls").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Worksheets(Worksheets.Count).Columns("A:AA").EntireColumn.AutoFit
Range("A1").Select
Windows("test1.xlsm").Activate
Application.CutCopyMode = False
Range("A1").Select
End Sub
I need to do it between activating windows or it doesn't work.