Hello All
I found this via google searching and have been able to modify slightly to find empty cells and duplicates.
Code:' MyConCat ' ' Very simple By Apostolos Goulandris Function MyConCat(myDelimiter As String, Avar) As String Dim b As Variant, Dum As String If IsMissing(myDelimiter) Then myDelimiter = "" For Each b In Avar If b <> 0 Then 'ADDED THIS LINE TO ALLOW FOR BLANK CELLS If InStr(1, Dum, b) = 0 Then 'ADDED THIS LINE TO CHECK DUPLICATES Dum = IIf(Len(b) > 0, Dum & myDelimiter & b, Dum) End If End If Next MyConCat = IIf(Len(myDelimiter) > 0, Mid(Dum, Len(myDelimiter) + 1, Len(Dum)), Dum) End Function
In the previous post, i needed to concatenate 2 cells and compare against 2 column ranges, then return the concatenated unique string... example how I tried in is
=MyConCat(",",IF(((A2:A7)&(B2:B7))=((C11)&(C12)),E 2:G7,""))
This seemed to work fine for me. Any suggestions or improvements most welcome.
Please acknowledge Apostolos Goulandris as he wrote the initial script




Reply With Quote
Bookmarks