I have two Workbooks Test1 ( the master file) and Test2(for an individuals use) . I have a macro that will copy all files in test1 that is for "LIZ" to Test2 This is my code
Dim x As Integer
Workbooks.Open Filename:= _
"test2.xls"
Windows("test1.xls"
.Activate
For Each cell In Range("i1", Range("i2"
.End(xlDown))
x = x + 1
If Range("I" & x).Value = "" Then Exit For
If Range("I" & x).Value = "Liz" Then
Range("i" & x).EntireRow.Copy
Windows("test2.xls"
.Activate
Range("A65536"
.End(xlUp).Offset(1, 0).Select
ActiveCell.PasteSpecial (xlPasteValues)
Windows("test1.xls"
.Activate
End If
Next cell
Workbooks("Test2.XLS"
.Close SaveChanges:=True
Application.CutCopyMode = False
But fefore it paste the records to test2 I want it to check to see it that record number (ie 15) is already in Test2 if so replace it with the new one. If not just copy the new on
into test2.
How could I do this ?
Thanks
Liz
Dim x As Integer
Workbooks.Open Filename:= _
"test2.xls"
Windows("test1.xls"
For Each cell In Range("i1", Range("i2"
x = x + 1
If Range("I" & x).Value = "" Then Exit For
If Range("I" & x).Value = "Liz" Then
Range("i" & x).EntireRow.Copy
Windows("test2.xls"
Range("A65536"
ActiveCell.PasteSpecial (xlPasteValues)
Windows("test1.xls"
End If
Next cell
Workbooks("Test2.XLS"
Application.CutCopyMode = False
But fefore it paste the records to test2 I want it to check to see it that record number (ie 15) is already in Test2 if so replace it with the new one. If not just copy the new on
into test2.
How could I do this ?
Thanks
Liz