Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub mergecolumns()
LastrowA = Cells(Rows.Count, "A").End(xlUp).Row LastrowB = Cells(Rows.Count, "B").End(xlUp).Row If LastrowA LastrowB Then LastRow = LastrowA Else LastRow = LastrowB End If Set SourceRange = Range(Cells(1, "A"), Cells(LastRow, "B")) RowCount = 1 For Each cell In SourceRange If Not IsEmpty(cell.Value) Then If RowCount = 1 Then Cells(1, "D") = cell.Value RowCount = RowCount + 1 Else Set DestRange = Range(Cells(1, "D"), _ Cells(RowCount - 1, "D")) Set c = DestRange.Find(what:=cell, LookIn:=xlValues) If c Is Nothing Then Cells(RowCount, "D") = cell.Value RowCount = RowCount + 1 End If End If End If Next cell Range(Cells(1, "D"), Cells(RowCount - 1, "D")).Sort _ Key1:=Range("D1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub "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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check your other posts, too.
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? -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In , Dave Peterson
spake thusly: Check your other posts, too. IOW: "It is possible that duplicates of this text may appear in" other posts. :-) 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? =dman= |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 10 Aug, 01:39, Dallman Ross <dman@localhost. wrote:
In , Dave Peterson spake thusly: Check your other posts, too. IOW: "It is possible that duplicates of this text may appear in" other posts. :-) 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? =dman= many thanks for your help. i post so that i get an answer, spreading my chances as it were. well done for pointing that out in your pointless post. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combine data in two columns into one and sort the combined column alphabetically..how?? | Excel Discussion (Misc queries) | |||
Can I combine 4 columns of data into one column? | Excel Discussion (Misc queries) | |||
how do you sort ascend two columns alphabetically | New Users to Excel | |||
How do I sort a column alphabetically not consider "the" or "a"? | Excel Discussion (Misc queries) | |||
How do I combine tabulated data into a single column and list alphabetically? | Excel Discussion (Misc queries) |