LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Find duplicated values and paste range results on next sheet - nextavailable row

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find minimum duplicated values in a range? SteveMcCready Excel Worksheet Functions 2 July 15th 08 02:15 PM
Duplicates are GOOD: How to find the most duplicated values? flanneryd Excel Worksheet Functions 1 May 8th 07 09:54 PM
To find duplicated values in a range beechum1 Excel Worksheet Functions 1 February 10th 06 04:31 AM
code to FIND value, copy, paste values onto other sheet ufo_pilot Excel Programming 2 December 6th 05 04:14 PM
Find range in one sheet, then paste in the other (one by one) cskgg[_6_] Excel Programming 3 August 13th 04 01:23 PM


All times are GMT +1. The time now is 08:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"