Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Matching values in 1 column to data in another


Hello,

Pulling what's left of my hair out trying to come up with a solution.
I have a column (G), with a list of IDs (IWEC44332). Each ID has
numbers associated with it in another column (F). I would like t
create a macro or function to search column G and list both number
associated with the ID #. Displaying those numbers either together i
1 column (H) or 2 columns (H & I). Is this possible ??

--
Ore
-----------------------------------------------------------------------
Oreg's Profile: http://www.excelforum.com/member.php...nfo&userid=919
View this thread: http://www.excelforum.com/showthread.php?threadid=38030

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Matching values in 1 column to data in another


anilsolipuram & Don, Neither macros were working for me so I went back
to my original message and noticed I mixed up my columns and should
have been more descriptive. I tried to modify your macros with no
luck.. Column (F) is a list of IDs. Example: IWEC432151,
IWEC968489..... In column (F), each IWEC # shows up twice. In Column
(G) are other numbers associated to the IWEC #. Example: 1,2,5,15....
The outcome I am hoping for is a macro to search column G, list each
IWEC number once in column (H), match the data in Column (G) and list
it in Columns (I) & (J).

Example:
Columns F G H I J
IWEC456934 1 IWEC456934 1 5
IWEC790234 2 IWEC790234 2 15
IWEC456934 5
IWEC790234 15

Thanks,
Oreg


--
Oreg
------------------------------------------------------------------------
Oreg's Profile: http://www.excelforum.com/member.php...fo&userid=9195
View this thread: http://www.excelforum.com/showthread...hreadid=380308

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Matching values in 1 column to data in another


You have to select all columns and sort it by ids first.

I am assuming the ids range from f2:f88, you can edit the range as yo
want.

try it now and let me know what ever

Sub Macro1()
Dim INIT, I, r, val As Variant
Dim ra As Range
I = 0
Range("f2:f88").Select
Set ra = Selection
For Each c In ra

If I = 0 Then

INIT = c.Value
r = c.Row
I = 1
Else

If (c.Value = INIT) Then
val = val & c.Row & ","
Else
MsgBox val
t = Split(val, ",")
If UBound(t) 0 Then
Range("h" & r).Value = Range("f" & r).Value
Range("i" & r).Value = Range("g" & r).Value
For j = 0 To UBound(t)
temp = t(j)
If temp = "" Then
GoTo a:
Else
Range("i" & r).Offset(0, j + 1).Value
Range("g" & temp).Value
End If
Next
a:
End If
val = ""
INIT = c.Value
r = c.Row
End If
End If
If c.Value = "" Then
End
End If
Next
End Su

--
anilsolipura
-----------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...fo&userid=1627
View this thread: http://www.excelforum.com/showthread.php?threadid=38030

  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Matching values in 1 column to data in another


anilsolipuram,

WOW!!!! This works great! Thanks so much for taking the time

--
Ore
-----------------------------------------------------------------------
Oreg's Profile: http://www.excelforum.com/member.php...nfo&userid=919
View this thread: http://www.excelforum.com/showthread.php?threadid=38030

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
MATCHING A VALUE IN A CELL TO A COLUMN OF VALUES IN ANOTHER SHEET carrach Excel Discussion (Misc queries) 3 February 6th 10 04:32 PM
If two criteria match then sum matching values in another column Diddy Excel Worksheet Functions 5 February 25th 09 06:03 PM
Select 50 greatest values with column matching [email protected] Excel Discussion (Misc queries) 2 November 24th 06 09:14 AM
returning all matching values in column A that have the same value for columnB [email protected] Excel Worksheet Functions 3 August 30th 06 06:51 PM
Matching values in 1 column to data in another anilsolipuram[_77_] Excel Programming 0 June 18th 05 02:00 PM


All times are GMT +1. The time now is 03:00 AM.

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"