![]() |
|
|
|
#1
|
|||
|
|||
|
I want to take two columns that both contain text data and make a new column that includes all of the data for both columns.
This seems like a simple chore but it is eluding me so far. I find info on concatenating data, merging data, etc. but nothing on simply combining the data of two columns......... so if I have 10 entries in one column and 10 in another the resulting column will have all 20. I appreciate anyone being able to assist after they stop laughing that I can't figure it out. |
|
#2
|
|||
|
|||
|
OIC...yeah, there's a way to do that. It takes code. Here is one I made with a lot of help from one of the code gurus here. For the data selected in multiple columns, this will put them all in another column with a blank column between and sort the results. You can delete the sort or change the output column as you see fit.
Code:
Sub Unwind()
Dim OutCell As Range
Ctr = 0
Set OutCell = Selection.Cells(1, 1).Offset(0, Selection.Columns.Count + 1)
For Each Cell In Selection
OutCell.Offset(Ctr, 0).Value = Cell.Value
Ctr = Ctr + 1
Next Cell
ActiveWorkbook.Worksheets("Totaler").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Totaler").Sort.SortFields.Add Key:=Range("F1"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Totaler").Sort
.SetRange Range("F1:F10709")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Selection.End(xlUp).Select
End Sub
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Spreadsheet with "CR" & "DB" in amount & number columns. | bfisher | Excel | 4 | 09-28-2015 07:03 AM |
| remove repeated words with " macro " or " wild cards " in texts with parentheses and commas | jocke321 | Word VBA | 2 | 12-10-2014 11:27 AM |
| How to edit the "Format" and the "show level" of an EXISTING table of content? | Jamal NUMAN | Word | 2 | 08-14-2011 10:46 AM |
How to choose a "List" for certain "Heading" from "Modify" tool?
|
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |
| "Microsoft Excel Application" missing in the "Component Services" on win08 | sword.fish | Excel | 0 | 02-26-2010 02:09 PM |