turtlejack
Technical User
I am trying to copy certain cells from one worksheet to another.on the first much of the data in the column to be copied, is duplicate. on the page I am trying to copy to, I only want one instance of each bit of data.
in the following code, I stepped into the code, and it is copying data that is equal to data on the previous row. and it should not be.
Sub locate()
Dim main As Worksheet
Dim locate_request As Worksheet
c = 20
v = 6
p = 3
Set main = Worksheets("main")
Set locaterequest = Worksheets("locate request")
For v = v To c
If main.Range("b" & v) >= locaterequest.Range("a" & (v - 1)) Then
main.Range("b" & v).Copy locaterequest.Range("a" & p)
p = p + 1
End If
Next v
End If
End Sub
in the following code, I stepped into the code, and it is copying data that is equal to data on the previous row. and it should not be.
Sub locate()
Dim main As Worksheet
Dim locate_request As Worksheet
c = 20
v = 6
p = 3
Set main = Worksheets("main")
Set locaterequest = Worksheets("locate request")
For v = v To c
If main.Range("b" & v) >= locaterequest.Range("a" & (v - 1)) Then
main.Range("b" & v).Copy locaterequest.Range("a" & p)
p = p + 1
End If
Next v
End If
End Sub