• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to merge a numbers from 3 cells, eliminate repetitive numbers, and sort it?

David gonzalez

New Member
Hi, again, this is david...


The problem is that i pasted in 3 cells a 3 set of numbers,

-.each cell have a not repeated numbers

AND

-.Some numbers appear 1 time with in the 3 cells

BUT

-.some numbers might will be repeated with in the 3 cells


e.g :


Cell F8-->08-31-25-15-27-29-36-14-17-23

Cell F9-->21-22-23-24-25-26-27-28-29-30

Cell F10->04-03-02-01-31-32-33-34-35-36

---------------------------------------

Cell F11->


i need to find a formula,macro or simple command to perform the follow :


1-.Merge The 3 sets of numbers from cell F8, F9, and F10 and Copy in "Cell F11"

2-.Sort the 3 sets of Numbers from Low to High

3-.Show each numbers just once In Cell F11 (no repeated numbers)


e.g


Cell F8-->08-31-25-15-27-29-36-14-17-23<-no sorted,each #s appear 1 time in each cell

Cell F9-->21-22-23-24-25-26-27-28-29-30<-some #s appear repeated with in the 3 cell,

Cell F10->04-03-02-01-31-32-33-34-35-36<- e.g : #23, #25, #27 and #31 appear twice.

----------------------------------------

Cell F11->01-02-03-04-08-14-15-17-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36<- here


in cell F11 the 3 cell should appear merged, each number should appear 1 time and sorted..


any help, recommendation on how to do'it is appreciated


Thank you very much !!


Best Regards


David
 
Hi all !!!!


about the question of my second problem it was solved


"How to merge a numbers from 3 cells, eliminate repetitive numbers, and sort it?"


of course, a nice person helped me, This is how was done using a term (i supposed) called UDF


I Open the VBA editor by hitting Alt F11.

in a new module with function -> Insert - Module

i pasted the function describe bellow :


-------------------------------------------------------------------------


Function SortUniq(rng As Range, delim As String) As String

Dim r As Range, e

With CreateObject("System.Collections.ArrayList")

For Each r In rng

For Each e In Split(r.Value, delim)

If Not .Contains(Trim$(e)) Then .Add Trim$(e)

Next

Next

.Sort

SortUniq = Join$(.ToArray, delim)

End With

End Function


------------------------------------------------------------------------


then i when back to the sheet by hitting Alt F11.


Then In cell F11, where it was the place that i want to get the merged cell

and sort the numbers i enter : =SortUniq(F8:F10,"-")


And finally, i saved the workbook as a macro enabled workbook .xlsm


that's all !!


Thank you very much, and i'll be learning and asking questions one in while


Best Regards from Miami


David
 
Back
Top