Hello,
I want to delete the existing data before i paste the new data in a workbook. So how do i do it?
I am using 2 workbooks.
workbook 1: has the data from which i will copy.
data.PNG
workbook 2 :is were i paste the data.
tb1.PNG
i am able to copy and paste the data. But the problem i am facing is that workbook 2 already consists of some data in it and when i paste the data in it then it gets added up with the existing data, so how do i delete the existing data before pasting the new data.
Below is the code:
Windows("kl.xls").Activate 'workbook1
Selection.AutoFilter
ActiveSheet.Range("$A$1:$H$16").AutoFilter Field:=8, Criteria1:="US"
Range("A2:G2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("tecdata.xlsx").Activate 'workbook2
Sheets("Sheet1").Select
Range("A3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
I have attached both the workbooks.
Regards
Wither
Bookmarks