VBA pasting data into table

Status
Not open for further replies.

Wigman86

New Member
Joined
Oct 12, 2017
Messages
18
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
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Duplicate https://www.mrexcel.com/forum/excel-questions/1062062-vba-pasting-data-into-table.html#post5104305

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

If you do not receive a response, you can "bump" it by replying to it again, though we advise you to wait 24 hours before doing and not to bump a thread more than once a day.

 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top