Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm having a tough time getting all the values out of an array and into
an excel range. When I try to do it I only get the first value in the array in all the cells in the range. Instead I want each element. Here's the code: Dim aSMASMA As Variant Dim aTradedecision(1996) As Variant Dim j As Integer Dim element As Variant Dim intTotaltradingdays As Integer aSMASMA = Range("K5:L2000").Value j = 0 For Each element In aSMASMA If aSMASMA(j + 1, 2) < Empty Then aTradedecision(j) = aSMASMA(j + 1, 1) - aSMASMA(j + 1, 2) j = j + 1 Else Exit For End If Next intTotaltradingdays = j Range("M5").Resize(j).Value = aTradedecision() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Mutli-dimensional Array to Single-Dimension Array | Excel Programming | |||
HOW TO ASSIGN 2 DIMENSION ARRAY VALUES FROM 2 COLUMNS? | Excel Programming | |||
Writing Single Dimension Array to Active Sheet | Excel Programming | |||
Array transfer - 1 dimension v. 2 dimension | Excel Programming | |||
single dimension array | Excel Programming |