View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default accessing data from an array

Assume Nums is a single column or single row

Dim varData() as double
Redim VarData(1 to Range("Nums").count, 1 to 1)

i = 0
For each c in Range("nums")
i = i + 1
varData (i+1) = c.Value
Next

Range("A1").Resize(i,1).Value = varData

--
regards,
Tom Ogilvy


"madge" wrote in message
m...
I have a variable that look like:

varData = "2.2, 3.2, 4.3" and I need to plot this on a spreadsheet
with the numbers in separate cells. i.e. The output needs to look
like:
2.2
3.2
4.3

I cannot figure out how to do this.

varData is a Variant but is not an Array. i.e It's declaration does
not have varData(). I do have an integer (i) that holds the number of
items that were put into varData. The code for this is something
like:

For each c in Range("nums")
varData = varData & "," & c.Value
i = i + 1
Next

But I am stuck as to how I retrieve the info from varData and plot it
into separate cells. I would appreciate any advice with how to handle
this.

Thank you
madge