Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheet 1. Has two sets of data. B6:G and I6:N.
Numeric values in columns B6 & I6. For any instance that the number in B6 is also repeated in I6, copy the row B:G to second sheet. Second sheet "results" already has data starting at a4:F4. Each time code is run, place the data on the next available row. The code below is a good start, it copies any numbers matching in B & I to second sheet. But it does not paste the range B:G for the number. And it does not find the next available row. Sub ABC() Dim cell As Range, c As Range Dim i As Range, rw As Long Dim sh As Worksheet With Worksheets("Data") Set c = .Range(.Cells(6, "B"), .Cells(6, "B").End(xlDown)) Set i = .Range(.Cells(6, "I"), .Cells(6, "I").End(xlDown)) End With rw = 2 Set sh = Worksheets("RESULTS") For Each cell In c If Application.CountIf(i, cell) 0 Then sh.Cells(rw, 1) = cell rw = rw + 1 End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I find minimum duplicated values in a range? | Excel Worksheet Functions | |||
Duplicates are GOOD: How to find the most duplicated values? | Excel Worksheet Functions | |||
To find duplicated values in a range | Excel Worksheet Functions | |||
code to FIND value, copy, paste values onto other sheet | Excel Programming | |||
Find range in one sheet, then paste in the other (one by one) | Excel Programming |