#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Comma

Is there away to create a macro to put numbers in one row with comma
between them instead having them in 3000 rows?
From
A
1 5656565656
2 5353535353
3 6262626262
4 3535353535
5 2326235623

To
A
1 "5656565656","5353535353","6262626262","3535353535 ","2326235623"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Comma

the last column is IV. there is a limit of 230 columns. the number of rows
can be in the 1000. You will not get all your data in 1 row.

"MarkyMark" wrote:

Is there away to create a macro to put numbers in one row with comma
between them instead having them in 3000 rows?
From
A
1 5656565656
2 5353535353
3 6262626262
4 3535353535
5 2326235623

To
A
1 "5656565656","5353535353","6262626262","3535353535 ","2326235623"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Comma

IV is column 256 and xl2007 extended that to 16384 columns (XFD).

And there's 64k of rows in xl97-xl2003. 1Meg in xl2007.

But I agree with your question....

10 characters surrounded by a pair of double quotes and separated by a comma
would mean that:

3000 * (10+2+1) Characters in that one giant cell.
3000 * 13
39000

And excel can hold about 32k characters per cell.

Maybe the question becomes: What does the OP really want?

Joel wrote:

the last column is IV. there is a limit of 230 columns. the number of rows
can be in the 1000. You will not get all your data in 1 row.

"MarkyMark" wrote:

Is there away to create a macro to put numbers in one row with comma
between them instead having them in 3000 rows?
From
A
1 5656565656
2 5353535353
3 6262626262
4 3535353535
5 2326235623

To
A
1 "5656565656","5353535353","6262626262","3535353535 ","2326235623"



--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Comma

10 * 3000 = 30000 + 2999 commas + 6000 double quotes would make more
characters than a cell can hold.

Sub CCC()
Dim cell As Range, s As String
For Each cell In Range("A1:A3000")
s = s & """" & cell.Value & ""","
Next
Range("B9").Value = Left(s, Len(s) - 1)


End Sub

would be the basic approach

--
Regards,
Tom Ogilvy


"MarkyMark" wrote:

Is there away to create a macro to put numbers in one row with comma
between them instead having them in 3000 rows?
From
A
1 5656565656
2 5353535353
3 6262626262
4 3535353535
5 2326235623

To
A
1 "5656565656","5353535353","6262626262","3535353535 ","2326235623"


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Comma


As Dave pointed out, getting 10 lbs into a 5 lb bag is difficult.
If you can live with multiple bags then (data is in B5:B9)...

Sub InsertComma()
Dim vArr As Variant
vArr = Join(Application.Transpose(Range("B5:B9")), ",")
Range("C5").NumberFormat = "@"
Range("C5").Value = vArr
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"MarkyMark"
wrote in message
Is there away to create a macro to put numbers in one row with comma
between them instead having them in 3000 rows?
From
A
1 5656565656
2 5353535353
3 6262626262
4 3535353535
5 2326235623

To
A
1 "5656565656","5353535353","6262626262","3535353535 ","2326235623"



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Comma

Yes, but with 3000 10-digit numbers including commas, you would exceed Excel's
32.767 character limit per cell.

You also would not be able to see or print more than about 100 of them due to
Excel's 1024 limit on visible characters in a cell.

Still want to do this?


Gord Dibben MS Excel MVP

On 21 Feb 2007 10:19:26 -0800, "MarkyMark" wrote:

Is there away to create a macro to put numbers in one row with comma
between them instead having them in 3000 rows?
From
A
1 5656565656
2 5353535353
3 6262626262
4 3535353535
5 2326235623

To
A
1 "5656565656","5353535353","6262626262","3535353535 ","2326235623"


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Comma

Thank you all i have 2007 office

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Comma

One cell in 2007 is pretty much the same as one cell in earlier versions. to
the best of my knowledge, the limit is still 32K.

Nonetheless, I gave you a macro to try it.

--
Regards,
Tom Ogilvy


"MarkyMark" wrote:

Thank you all i have 2007 office


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
Extract the text between last comma and last but one comma. Sreedevi Excel Worksheet Functions 2 March 5th 08 11:12 PM
Comma Delimited-need comma at beginnng & end Tattoo Excel Discussion (Misc queries) 2 December 11th 07 04:39 PM
New row after every comma TooN Excel Discussion (Misc queries) 5 October 10th 06 03:28 PM
Comma Gary Excel Worksheet Functions 3 July 17th 06 06:05 AM
Excel How do I create a comma delineated xls file to a comma delineated. Mark Excel Discussion (Misc queries) 0 November 26th 04 10:28 PM


All times are GMT +1. The time now is 09:42 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"