View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Return Unique Consecutive Duplicate Values across Single Row

Sub sam()
Dim s As String
For i = 1 To 8
For j = 2 To 7
v = Cells(j, i).Value
If Cells(j - 1, i).Value = v Then
If s = "" Then
s = v
Else
s = s & "," & v
End If
MsgBox ("column " & i & " " & v)
End If
Next
Next
MsgBox (s)
End Sub

gives result in MSGBOX format. You can modify the code if you need the
results put back into the worksheet.
--
Gary's Student
gsnu200703


"Sam via OfficeKB.com" wrote:

Hi All,

I have a Named Range called "Data" that spans 8 columns and 7 rows. A Numeric
Value will appear only once in a row. Each row's Numeric Values are in
ascending order. A unique consecutive duplicate MUST be in the SAME column.

I would like to Return across a single row unique consecutive duplicates
(single instance
of a consecutive duplicate value in the SAME column) in ascending order.

Sample Data Layout:

101 102 107 110 145 370 490 501
104 106 107 144 360 430 470 580
125 129 140 150 350 430 460 590
101 102 129 130 149 330 440 578
101 108 120 129 200 280 430 535
100 111 170 175 176 280 420 520
121 189 170 202 229 230 420 521

Expected Results: Unique Duplicate Returned across Single Row
101 107 170 280 420 430

Column 1 = 101
Column 3 = 107, 170
Column 6 = 280, 430
Column 7 = 420


Thanks,
Sam

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200702/1