Hello All
Sorry for the confusion. I have updated the code below to give a better Idea. What I am doing is filtering the "Data" sheet for anything equal to "I" in column 4 and not equal to "DDP" in column 9.
I am then copying this data and want to add code to paste all the data copied into "Table 9" on the International tab in row 11 and have all the following rows in the table populate also. i hope this makes sense. I am not sure how to write the code for this. Thanks.
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim a As Long
Dim s1 As Worksheet, s4 As Worksheet, tbl As ListObject
Set s1 = Sheets("Data")
Set s4 = Sheets("International")
Set tbl = s4.ListObjects("Table9")
a = s1.Cells(Rows.Count, 1).End(xlUp).Row
'Filter for I and not equal to DDP on Data sheet and Copy and paste into International Sheet
s1.Range("$a$10:$ca$10").AutoFilter Field:=4, Criteria1:="I"
s1.Range("$a$10:$ca$10").AutoFilter Field:=9, Criteria1:="<>DDP*"
s1.Range("a11:ap" & a).SpecialCells(xlCellTypeVisible).Copy s4.Range("A11")
If s1.AutoFilterMode Then s1.ShowAllData
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "Done!"
End Sub
Sorry for the confusion. I have updated the code below to give a better Idea. What I am doing is filtering the "Data" sheet for anything equal to "I" in column 4 and not equal to "DDP" in column 9.
I am then copying this data and want to add code to paste all the data copied into "Table 9" on the International tab in row 11 and have all the following rows in the table populate also. i hope this makes sense. I am not sure how to write the code for this. Thanks.
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim a As Long
Dim s1 As Worksheet, s4 As Worksheet, tbl As ListObject
Set s1 = Sheets("Data")
Set s4 = Sheets("International")
Set tbl = s4.ListObjects("Table9")
a = s1.Cells(Rows.Count, 1).End(xlUp).Row
'Filter for I and not equal to DDP on Data sheet and Copy and paste into International Sheet
s1.Range("$a$10:$ca$10").AutoFilter Field:=4, Criteria1:="I"
s1.Range("$a$10:$ca$10").AutoFilter Field:=9, Criteria1:="<>DDP*"
s1.Range("a11:ap" & a).SpecialCells(xlCellTypeVisible).Copy s4.Range("A11")
If s1.AutoFilterMode Then s1.ShowAllData
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "Done!"
End Sub