S
scottzuehl
I am trying to get the values out of 'buffprice' and 'buffdate' . When
I copy them to a range I only get the first value of each duplicated
down the entire range. How do I get each individual value?
thx
********************************************************
Dim v1 As Variant
Dim j2 As Variant
Dim j1 As Integer
Dim i1 As Integer
Static buffdecision(800) As Variant
Static buffdate(800) As Variant
Static buffprice(800) As Variant
Dim n As Variant
Dim nprice As Variant
Dim ndate As Variant
Dim v2 As Variant
Dim i2 As Integer
Dim v3 As Variant
Dim i3 As Integer
v1 = Range("M5:M2000").Value
v2 = Range("E5:E2000").Value
v3 = Range("A5:A2000").Value
j1 = 1
j2 = 2
n = 0
For i1 = LBound(v1, 1) To UBound(v1, 1)
If IsNumeric(v1(j1, 1)) Then
If (v1(j1, 1) > 0 And v1(j2, 1) < 0) Or (v1(j1, 1) <
0 And v1(j2, 1) > 0) Then
buffdecision(n) = v1(j1, 1)
buffprice(nprice) = v2(j1, 1)
buffdate(ndate) = v3(j1, 1)
n = n + 1
nprice = nprice + 1
ndate = ndate + 1
End If
j1 = j1 + 1
j2 = j2 + 1
End If
Next
Range("S5").Resize(j1 - 1).Value = buffdecision()
Range("S5").Resize(j1 - 1).Value = buffprice()
Range("T5").Resize(j1 - 1).Value = buffdate()
*************************************************************
I copy them to a range I only get the first value of each duplicated
down the entire range. How do I get each individual value?
thx
********************************************************
Dim v1 As Variant
Dim j2 As Variant
Dim j1 As Integer
Dim i1 As Integer
Static buffdecision(800) As Variant
Static buffdate(800) As Variant
Static buffprice(800) As Variant
Dim n As Variant
Dim nprice As Variant
Dim ndate As Variant
Dim v2 As Variant
Dim i2 As Integer
Dim v3 As Variant
Dim i3 As Integer
v1 = Range("M5:M2000").Value
v2 = Range("E5:E2000").Value
v3 = Range("A5:A2000").Value
j1 = 1
j2 = 2
n = 0
For i1 = LBound(v1, 1) To UBound(v1, 1)
If IsNumeric(v1(j1, 1)) Then
If (v1(j1, 1) > 0 And v1(j2, 1) < 0) Or (v1(j1, 1) <
0 And v1(j2, 1) > 0) Then
buffdecision(n) = v1(j1, 1)
buffprice(nprice) = v2(j1, 1)
buffdate(ndate) = v3(j1, 1)
n = n + 1
nprice = nprice + 1
ndate = ndate + 1
End If
j1 = j1 + 1
j2 = j2 + 1
End If
Next
Range("S5").Resize(j1 - 1).Value = buffdecision()
Range("S5").Resize(j1 - 1).Value = buffprice()
Range("T5").Resize(j1 - 1).Value = buffdate()
*************************************************************