Hi Guys,
I need my macro to ignore any errors and keep going.
This is what I have. It copies data from two columns, on two seperate tables and puts them on another sheet.
Right now, if filtering produces no results to copy, it dies. I want it to just go 'oh well' if there is nothing to do, and keep going.
Can it be made so that it moves on if it has nothing to copy?
I need my macro to ignore any errors and keep going.
This is what I have. It copies data from two columns, on two seperate tables and puts them on another sheet.
Right now, if filtering produces no results to copy, it dies. I want it to just go 'oh well' if there is nothing to do, and keep going.

Code:
Sub createlist()
Sheets.Add.Name = "List"
Sheets("List").Visible = True
Sheets("sheet1").Select
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=7, Criteria1:=
"<>"
Range("Table1[col1],table1[col4]").SpecialCells(xlCellTypeVisible).Select
Selection.copy
Sheets("List").Select
Worksheets("List").Cells(Rows.Count, 1).End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Sheets("sheet2").Select
ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=7, Criteria1:= "<>"
Range("Table2[col1],table2[col4]").SpecialCells(xlCellTypeVisible).Select
Selection.copy
Sheets("List").Select
Worksheets("List").Cells(Rows.Count, 1).End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
End Sub
Can it be made so that it moves on if it has nothing to copy?