Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to different value from duplicate selection - macro help

I am writing to seek help in updating the following code below, so the macro function allows me to look through data which have duplicate name values (from column A), to identify different rows of data from column J.

For example please input sheet from the attachment. Code is behind input_data sheet.

Process the macro, should look through lines of data which have duplicate name values (from column A), identify rows from column J are different from the duplicate values. The macro should highlight the difference in yellow, as final output.

Expected output please see output sheet from the attachment.

sample file = https://app.box.com/s/xo11dikkydxl4v89i7kh664qjzfqnxku

Any help would be very much appreciated.


Sub checkCurr()
Dim coll As New Collection, arr, i As Long, strKey As String, v
With Sheets("Input_data").Range("A1").CurrentRegion
arr = .Value
For i = 2 To UBound(arr, 1)
strKey = arr(i, 1) & Chr$(2) & arr(i, 10)
On Error Resume Next
coll.Add Key:=strKey, Item:=Array(UCase$(arr(i, 11)), UCase$(arr(i, 12)))
If Err.Number = 457 Then
v = coll(strKey)
If UCase$(arr(i, 11)) < v(0) Or UCase$(arr(i, 12)) < v(1) Then .Rows(i).Interior.Color = RGB(255, 255, 0)
End If
On Error GoTo 0
Next i
End With
End Sub
Reply
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
Find duplicate, save in a list, delete duplicate using macro Erica[_3_] Excel Programming 1 January 27th 10 07:53 PM
Count duplicate values in a selection Abdul Shakeel Excel Programming 1 September 2nd 09 11:07 AM
SELECT DUPLICATE IN SELECTION VIJAY BHARDWAJ Excel Worksheet Functions 2 March 9th 09 03:17 PM
Deleting Duplicate Rows In a Selection with a True Statement Josh heep Excel Programming 2 February 13th 08 08:37 PM
duplicate listbox selection to range of cells? lozc Excel Programming 4 February 9th 06 02:02 AM


All times are GMT +1. The time now is 08:19 AM.

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

About Us

"It's about Microsoft Excel"