Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello,
I'm looking for an easy/automated way to take care of the following: I have single columns of varying size (meaning number of values in the column) that I need to arrange into a single cell with the values separated by commas. E.g. 111 222 333 .... needs to be turned into 111,222,333,... These columns can contain from 2 to a few hundred values. Obviously, it would be easy to do this by hand for 2 values, but as the number of values grows, this becomes tedious and error-prone. Any suggestions would be greatly appreciated. Thank you. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
First select the set of cells you want to process and then run:
Sub merge_them() Set dest = Application.InputBox(prompt:="click on the destination cell", Type:=8) v = "" For Each r In Selection v = v & r.Value & "," Next dest.Value = Left(v, Len(v) - 1) End Sub The macro will ask you to pick the destination cell. -- Gary''s Student - gsnu200795 "Niniel" wrote: Hello, I'm looking for an easy/automated way to take care of the following: I have single columns of varying size (meaning number of values in the column) that I need to arrange into a single cell with the values separated by commas. E.g. 111 222 333 ... needs to be turned into 111,222,333,... These columns can contain from 2 to a few hundred values. Obviously, it would be easy to do this by hand for 2 values, but as the number of values grows, this becomes tedious and error-prone. Any suggestions would be greatly appreciated. Thank you. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks a lot, that works beautifully.
Had to make sure though that "Set dest = Application.InputBox(prompt:="click on the destination cell", Type:=8)" was all in one row, otherwise I got a syntax error. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COUNTIF: 2 criteria: Date Range Column & Text Column | Excel Worksheet Functions | |||
Return text in Column A if Column B and Column K match | Excel Worksheet Functions | |||
To copy values in a column relevant to text in an adjacent column? | Excel Worksheet Functions | |||
Wrap text in column headers to fit text in column | Excel Discussion (Misc queries) | |||
How I can print full text bigger than column, in repeat column | Excel Discussion (Misc queries) |