LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default writing a small array to a single cell as a string

I've been knocking my head against the desk for a few days about
this... probably due more to my inexperience than the difficulty of the
problem. I have a small (variable size )array and I want to write it to
a single cell as a string. Like this
10 12 10 12

I'm seeing lot's of things about turning stuff into arrays, but haven't
found anything I can adapt to going the other way. Here's my code:

Sub Tester3()

Dim aStr As String
Dim myarray(3)
myarray = Array("10", "12", "10", "12")
Dim i As Variant
For i = LBound(myarray) To UBound(myarray)
sStr = myarray(i) & ", " & IIf(aStr = "", "", ", ") & i.Value

Next i

Debug.Print (aStr)

I got the sStr - myarray... from something T. Ogilvy suggested for a
different, but to me similar problem. I get an error saying I need an
object. I know I need to concatenate the values, but what am I missing?
(besides decent knowledge;-)

a.j. fox

 
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
how to continue writing in a single cell? Ron Excel Discussion (Misc queries) 3 March 3rd 10 05:35 AM
Writing Single Dimension Array to Active Sheet Fid[_2_] Excel Programming 2 June 23rd 05 09:26 PM
having trouble writing string to cell-xl2k Terry Carpenter[_2_] Excel Programming 1 April 14th 05 06:24 PM
VBA - Convert my variable range array to single cell string Kevin G[_2_] Excel Programming 6 January 28th 04 07:20 AM
"Small" Multi-Dimensional Array Slow Writing To Cell Steve Hieb Excel Programming 2 September 6th 03 03:20 AM


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