ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MErge everything all colums into one (https://www.excelbanter.com/excel-programming/368551-merge-everything-all-colums-into-one.html)

Shan[_2_]

MErge everything all colums into one
 
I have a worksheet with many columns. I want to take the content of all
the columns and put it in just one column , lets say A. How can i go
about doing this?


[email protected]

Merge columns into one column
 
I'm fairly new at this and it's a steep learning curve - there are no
doubt more elegent ways to do this.. but if you have a limited number
of columns that you need to work with and you know the columns in
advance, this will do the trick...

================================================== =====
Sub merge()
Dim somestring As String
Dim somestring2 As String
Dim somestring3 As String
Dim mergedstring As String

somestring = Range("b1").Value
somestring2 = Range("c1").Value
somestring3 = Range("d1").Value

mergedstring = somestring & " " & somestring2 & " " & somestring3
Range("a1").Value = mergedstring

End Sub

================================================== =====

HTH

Gary


Excelenator[_9_]

MErge everything all colums into one
 

In Cell A2 put the formula:

=B2 & C2 & D2 & E2 ..... etc.

and all the data will be concatenated. If you want some delimiter you
can use this formula:

=B2 & "," & C2 & "," & D2 & "," & E2 ..... etc.

Then copy that formula down for the number of rows you have. If you
want it then to be values copy Column A and Paste Special Values in
Column A.





Shan Wrote:
I have a worksheet with many columns. I want to take the content of all
the columns and put it in just one column , lets say A. How can i go
about doing this?



--
Excelenator


------------------------------------------------------------------------
Excelenator's Profile: http://www.excelforum.com/member.php...o&userid=36768
View this thread: http://www.excelforum.com/showthread...hreadid=565652



All times are GMT +1. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com