I'm relatively new to VBA and while I can get a new workbook opened, I can't get the table to paste. I'm looking for it to paste exactly how it appears (starting in cell A1) and just can't get it there. How can I fix it?
VBA Code:
Sub exporttable()
Dim ws As Worksheet
Set ws = ActiveSheet With Workbooks("Test.xlsb")
ws.ListObjects(1).Range.Copy
Workbooks.Add
ws.ListObjects(1).Range.Paste
ActiveWorkbook.SaveAs "Test - " & Format(Date, "mmm-dd-yyyy") & ".xlsx"
ActiveWorkbook.Sheets(1).Name = Format(Date, "mmm-dd-yyyy")
End With
End Sub