Sunday, June 21, 2009

Arranging the stock price for event window

Please go to PhD freaks portal for details
Function test_adj(date1 As Variant, match, price, eve)
'Created by C A Yoonus and Surender Komera

Dim m, n, i, j, b, c As Variant, t, k, d
t = 1
m = Application.WorksheetFunction.Count(date1)
n = 1
ReDim b(n)
ReDim c(t)
'test_adj = m

For i = 1 To m

b(i) = date1(i) - match
n = n + 1
ReDim Preserve b(n)
If b(i) = 0 Then
j = i
End If
Next i


For k = j - eve To j + eve
c(t) = price(k)
t = t + 1
ReDim Preserve c(t)

Next k

d = Application.WorksheetFunction.Transpose(c)

test_adj = d







End Function

1 comment:

Preethi Rao said...

wow! mind boggling!! :)