Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Raju Boine.
 
Posts: n/a
Default column values to a cell with comma seperated

I have a column in which I got some values. Now I want to get those values in
to a cell with comma seperated.

Eg:
In column A
123
234
345
456

In Cell B2 I want 123, 234, 345, 456. Can some please help me.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Sub Test()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("B1").NumberFormat = "@"
For i = iLastRow To 2 Step -1
Range("B1").Value = "," & Cells(i, "A").Value & Range("B1").Value
Next i
Range("B1").Value = Range("A1").Value & Range("B1").Value
End Sub

--
HTH

Bob Phillips

"Raju Boine." wrote in message
...
I have a column in which I got some values. Now I want to get those values

in
to a cell with comma seperated.

Eg:
In column A
123
234
345
456

In Cell B2 I want 123, 234, 345, 456. Can some please help me.



  #3   Report Post  
olasa
 
Posts: n/a
Default


There's probably a much better way but...
1. Copy the column and Paste SpecialTranspose to get all values in a
row
2. Save AsBook1.csv (comma delimited)
3. Rename the file to Book1.txt
4. Open the file and Replace all ; to ,
5. Copy and Paste to B2
Done

HTH
Ola Sandström


--
olasa
------------------------------------------------------------------------
olasa's Profile: http://www.excelforum.com/member.php...o&userid=17760
View this thread: http://www.excelforum.com/showthread...hreadid=390488

  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

With all those steps, in what way is it better?

--
HTH

Bob Phillips

"olasa" wrote in
message ...

There's probably a much better way but...
1. Copy the column and Paste SpecialTranspose to get all values in a
row
2. Save AsBook1.csv (comma delimited)
3. Rename the file to Book1.txt
4. Open the file and Replace all ; to ,
5. Copy and Paste to B2
Done

HTH
Ola Sandström


--
olasa
------------------------------------------------------------------------
olasa's Profile:

http://www.excelforum.com/member.php...o&userid=17760
View this thread: http://www.excelforum.com/showthread...hreadid=390488



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
same cell from multiple sheets into one column Kel Excel Discussion (Misc queries) 0 February 18th 05 12:53 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"