LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Set intersection on Excel spreadsheet?

Dim cell as Range, cell1 as Range
dim sStr as String
for each cell in Range(A1:A3)
for each cell1 in Range("B1:B4)
if cell = cell1 then
sStr = sStr & cell & ", "
end if
next
Next
sStr = Left(sStr,len(sStr)-2)
msgbox sStr

You would have to add code if there will be duplicate numbers within a
single range.

--
Regards,
Tom Ogilvy


"Tim" <tim@smi wrote in message
...
I need a way to get the set intersection of two ranges of
cells on an
Excel spreadsheet. For example, if one range of cells has
the values 1,
2, 3 and another range has the values 1,3,5,6 then the
intersetion
function on these two ranges would return 1,3.
Any suggestions?





 
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
intersection of two tabs in excel betsy Excel Worksheet Functions 3 January 16th 09 04:45 AM
Intersection Excel User 123456 Excel Discussion (Misc queries) 3 June 5th 08 10:34 PM
Intersection help Ray Excel Discussion (Misc queries) 3 September 5th 07 04:15 PM
Intersection Jithu Excel Discussion (Misc queries) 5 August 2nd 07 08:12 AM
how do i get the intersection of two arrays in excel? Bibhu New Users to Excel 1 November 22nd 05 10:42 AM


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