Thread: Column to text
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Column to text

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.