Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with three columns find unique data
Okay, I have three columns, A B C A holds multiple occurrences of once appearing data in B. eg A B C 10 10 10 10 10 5 11 11 11 11 11 6 I need a script that will read A, find that value in B and paste corresponding C value in D. So for the above example D would be 5 5 5 5 6 6 6 6 I don't know where to even start. HELP! -- ColB ------------------------------------------------------------------------ ColB's Profile: http://www.excelforum.com/member.php...o&userid=36350 View this thread: http://www.excelforum.com/showthread...hreadid=561356 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with three columns find unique data
This is one interpretation. Minimal testing.
Sub Test123() Dim c As Range, cc As Range Dim r As Range Dim ws As Worksheet Dim v As Integer 'change data type to suit Set ws = ActiveSheet Set r = ws.Columns(2).SpecialCells(xlCellTypeConstants) For Each c In r.Cells If IsNumeric(c.Value) Then v = c(1, 2) Set cc = c(1, 0) Do Until cc.Value < c.Value cc(1, 4) = v If cc.Row = 1 Then Exit Do Set cc = cc(0) Loop End If Next End Sub Regards, Greg "ColB" wrote: Okay, I have three columns, A B C A holds multiple occurrences of once appearing data in B. eg A B C 10 10 10 10 10 5 11 11 11 11 11 6 I need a script that will read A, find that value in B and paste corresponding C value in D. So for the above example D would be 5 5 5 5 6 6 6 6 I don't know where to even start. HELP! -- ColB ------------------------------------------------------------------------ ColB's Profile: http://www.excelforum.com/member.php...o&userid=36350 View this thread: http://www.excelforum.com/showthread...hreadid=561356 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with three columns find unique data
Thanks Greg, worked like a charm. -- ColB ------------------------------------------------------------------------ ColB's Profile: http://www.excelforum.com/member.php...o&userid=36350 View this thread: http://www.excelforum.com/showthread...hreadid=561356 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need help comparing 2 columns of number to find unique numbers | Excel Worksheet Functions | |||
Find unique data by row | Excel Worksheet Functions | |||
Extract unique data across columns in a row. | Excel Discussion (Misc queries) | |||
Look up unique value over several columns of data | Excel Worksheet Functions | |||
find rows for unique data in 1 column and different data in other. | Excel Discussion (Misc queries) |