I have an Excel file, Competition database v1.0. From time to time the data will be updated.
I would like to filter each category and create a new workbook and paste the filtered data into it.
I managed to create a new workbook but it didn't copy the data.
I tried this.
Sub Createnewbook()
Dim wb As Workbook
Set wb = Workbooks.Add
Range("C2", Range("C2").End(xlDown).End(xlToRight)).Copy
wdApp.Selection.PasteExcelTable True, False, False
End Sub
Then I tried this:
Sub Createnewbook()
Dim wb As Workbook
Set wb = Workbooks.Add
' I got error from this line
Workbooks("Competition Database V1.0.xlsm").Worksheets("Competitor Info").Select
Worksheets("Competitor Info").Range("C2", Range("C2").End(xlDown).End(xlToRight)).Copy
wb.Worksheets("Sheet1").Range("A1").PasteExcelTable True, False, False
End Sub