Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Reading a Range

I have a range of cells, column that I would like to take
and place in a single cell separated by a comma. Below
is the result I would like to see.

23,43,589,432,12...

23
43
589
432
12
443
898
....

Any help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Reading a Range


For Each cell In Selection
sVal = sVal & "," & cell.Value
Next cell

Range("A1").Value = Right(sVal,Len(sVal)-1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Pablo" wrote in message
...
I have a range of cells, column that I would like to take
and place in a single cell separated by a comma. Below
is the result I would like to see.

23,43,589,432,12...

23
43
589
432
12
443
898
...

Any help would be greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Reading a Range

Pablo,

Try some code like the following

Sub AAA()
Dim S As String
Dim Rng As Range
For Each Rng In Range("A1:A10")
If Rng.Text < "" Then
S = S & Rng.Text & ","
End If
Next Rng
S = Left$(S, Len(S) - 1)
Debug.Print S
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Pablo" wrote in message
...
I have a range of cells, column that I would like to take
and place in a single cell separated by a comma. Below
is the result I would like to see.

23,43,589,432,12...

23
43
589
432
12
443
898
...

Any help would be greatly appreciated.



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
reading from SQL Texas Tonie[_2_] Excel Discussion (Misc queries) 0 November 9th 07 10:59 PM
Reading XML Ajit Excel Discussion (Misc queries) 1 October 2nd 07 10:54 PM
reading xls from asp mrweb Excel Programming 0 October 20th 03 08:54 PM
sub for reading Fernando Duran Excel Programming 4 September 15th 03 07:52 PM
Reading a named range Karl Thompson Excel Programming 1 July 10th 03 02:29 AM


All times are GMT +1. The time now is 03:39 PM.

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"