LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unique Records by Field

Merjet and Troy, thank you for your help. I really
appreciate your solutions.

-----Original Message-----
Suppose the three fields are columns B-D (2-4) starting
in row2. Then the following code will put a 1 in col A
when the next row doesn't match. (It assumes duplicates
are contiguous, not scattered.)

HTH,
Merjet

Sub macro1()
Dim iRow As Integer
Dim iCt As Integer
Dim ws As Worksheet

Set ws = Sheets("Sheet1")
iRow = ws.Range("B65536").End(xlUp).Row
ws.Range("A2:A" & iRow).Clear
ws.Range("A2") = 1
For iCt = 3 To iRow
If ws.Cells(iCt, 2) < ws.Cells(iCt - 1, 2) Or _
ws.Cells(iCt, 3) < ws.Cells(iCt - 1, 3) Or _
ws.Cells(iCt, 4) < ws.Cells(iCt - 1, 4) Then

_
ws.Cells(iCt, 1) = 1
Next iCt
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
Unique Values, not Unique Records steph44haf Excel Discussion (Misc queries) 1 May 12th 10 07:52 PM
Filer for unique records and return all column data for unique rec bseeley Excel Discussion (Misc queries) 1 September 12th 09 12:17 AM
Counting unique records in a field Loris Excel Discussion (Misc queries) 14 November 30th 08 04:55 PM
Unique Records Help pivot table Excel Worksheet Functions 2 August 23rd 08 12:12 AM
unique filter results in some non-unique records. Serials Librarian Excel Discussion (Misc queries) 2 May 26th 06 09:58 PM


All times are GMT +1. The time now is 05: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"