Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheet 1. Has two sets of data. B6:G and I6:N.
The code below copies the numbers in column B if they have a match in column I. How should I go about changing to copy not only B, but the remaining row info (B through G) if match. ? 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 | |||
Match with copy | Excel Discussion (Misc queries) | |||
Match and copy | Excel Worksheet Functions | |||
copy rows that do not match values in dynamic range. | Excel Programming | |||
copy no match | Excel Programming | |||
Maybe this isn't possible to match name and copy? | Excel Programming |