Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a single row of data, which will grow, which I need to merge into a
long list of text in one cell, so I can paste into another program. I have started with the concantenate function, but I could do with a function to automatically go down the list until there is no more data. I think I have seen this done, but I can't remember how. TIA |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
One way. Just make sure that there is an empty column between last data and
the column to fill. If putting data in col G then col F should be blank Sub mergecolumndata() mc = "a" lr = Cells(Rows.Count, mc).End(xlUp).Row For Each c In Range(Cells(2, mc), Cells(lr, mc)) lc = Cells(c.Row, mc).End(xlToRight).Column + 1 mystr = "" For i = 1 To lc mystr = mystr & Cells(c.Row, i) & "," Next i cells(c.Row, "g") = Left(mystr, Len(mystr) - 2) Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Terryrubby" wrote in message ... I have a single row of data, which will grow, which I need to merge into a long list of text in one cell, so I can paste into another program. I have started with the concantenate function, but I could do with a function to automatically go down the list until there is no more data. I think I have seen this done, but I can't remember how. TIA |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks for the quick reply.
I have added this macro to a shape, but it comes up with an error 1004 and highlights the mystr = mystr & Cells(c.Row, i) & "," line. Was I supposed to add in some information? At the moment all my data is in column a from row 1 to 29 if this helps. "Don Guillett" wrote: One way. Just make sure that there is an empty column between last data and the column to fill. If putting data in col G then col F should be blank Sub mergecolumndata() mc = "a" lr = Cells(Rows.Count, mc).End(xlUp).Row For Each c In Range(Cells(2, mc), Cells(lr, mc)) lc = Cells(c.Row, mc).End(xlToRight).Column + 1 mystr = "" For i = 1 To lc mystr = mystr & Cells(c.Row, i) & "," Next i cells(c.Row, "g") = Left(mystr, Len(mystr) - 2) Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Terryrubby" wrote in message ... I have a single row of data, which will grow, which I need to merge into a long list of text in one cell, so I can paste into another program. I have started with the concantenate function, but I could do with a function to automatically go down the list until there is no more data. I think I have seen this done, but I can't remember how. TIA |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sorry Don,
I knew what I wanted to say but it came across wrong. If I understand what you have written, can I substitute the the word column for row in certain lines, if not all. I haven't had a chance to try it yet, but will give it a go this evening |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() I still do NOT understand your problem. Send you file to my address below if you like. -- Don Guillett Microsoft MVP Excel SalesAid Software "Terryrubby" wrote in message ... Sorry Don, I knew what I wanted to say but it came across wrong. If I understand what you have written, can I substitute the the word column for row in certain lines, if not all. I haven't had a chance to try it yet, but will give it a go this evening |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to merge data from multiple columns to one column | Excel Discussion (Misc queries) | |||
How do I merge cells with multiple data values? | Excel Discussion (Misc queries) | |||
how to merge data from multiple columns to one column | Excel Discussion (Misc queries) | |||
Merge Data from Multiple Spreadsheets | Excel Worksheet Functions | |||
Merge Data From Multiple Worksheets | Excel Worksheet Functions |