Reputation: 369
I am trying to dump the content of an array of Doubles into a single Cell in Excel with VBA.
I found an Answer, which solves the problem for Strings or Variant, but not for Double.
Dim arr(1 To 3) As Double
arr(1) = 0.81
arr(2) = 0.95
arr(3) = 1.74
Worksheets("Test").Cells(1,1).Value = dump(arr, ";")
The Last line should write all the values from the Array to the Cell specified.
Edit: Changed 0,81 to 0.81 etc. (German System vs. International Standard)
Upvotes: 1
Views: 1003
Reputation: 3498
It will be a string anyway, looping or transposing or Use of Index(nice omegastripes): (plus change the , to .)
Dim arr(1 To 3) As Double
arr(1) = 0.81
arr(2) = 0.95
arr(3) = 0.74
Worksheets("Test").Cells(1, 1).Value = Join(Application.Transpose(Application.Transpose(arr)), ";")
Upvotes: 2