Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Need help comparing 2 columns of number to find unique numbers BP Excel Worksheet Functions 3 January 11th 10 03:05 PM
Find unique data by row Exanimo96 Excel Worksheet Functions 1 January 23rd 08 01:23 AM
Extract unique data across columns in a row. Exanimo96 Excel Discussion (Misc queries) 1 January 23rd 08 01:17 AM
Look up unique value over several columns of data H Excel Worksheet Functions 2 January 27th 07 12:01 AM
find rows for unique data in 1 column and different data in other. Dot Majewski Excel Discussion (Misc queries) 1 January 21st 05 12:23 AM


All times are GMT +1. The time now is 06:18 AM.

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

About Us

"It's about Microsoft Excel"