View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Combine data in two columns into one and sort the combined column

Select all of the entries in column A, choose Edit | Copy. Click in cell C1
and use Edit | Paste to paste them into column C. Select the entries in
column B, again use Edit | Copy and go to the cell below the last entry in
column C, click it and use Edit | Paste to add those to the list.
Click the 'C' to choose all of column C and either use the A|Z icon to sort
them or use Data | Sort and when asked if you wish to expand the area, reply
[No].

At this point you have both columns in one and they're sorted. Duplicate
entries will be grouped together within the column. If you need to identify
those, you can put this formula in column D at D1:
=IF(COUNTIF(C:C,C1)1,"Duplicate","")
fill the formula to the end of your list.

Or were you wanting a macro solution?

"Tommy" wrote:

I have two columns, A and B. Each column contains a list of data in
text format e.g. 01TI518A.PV . It is possible that duplicates of this
text may appear within either column. Also, the number of data values
in each column is variable as they are imported from an external
source into the worksheet. I would like to be able to combine the text
from both columns into a single list in a single column, say column C.
I would also like this column to be alphanumerically sorted. How do I
go about doing this?