F
fabio.folino
I'm writing my first vba function. I'm trying to test using and addin
that requires the date to be in the mm/dd/yyyy format. I want to test
from a specific start date to today and find the highest value. Here
is the code i have.
Function TestHigh(tSymbol As String, tDate As String)
Dim dHighDate As Date
Dim sHighPrice As Single
Dim iCounter As Integer
Dim sTestPrice As Single
sHighPrice = xlq(Symbol, "close", sDate)
dHighDate = tDate
dHighDate = dHighDate + 1
For counter = dHighDate To Date
sTestPrice = xlq(tSymbol, "close", Str(dHighDate))
If sTestPrice > sHighPrice Then
sHighPrice = sTestPrice
dHighDate = iCounter
End If
Next iCounter
TestHigh = sHighPrice
End Function
When i run the function its not even going into the for loop. Any
Ideas?
that requires the date to be in the mm/dd/yyyy format. I want to test
from a specific start date to today and find the highest value. Here
is the code i have.
Function TestHigh(tSymbol As String, tDate As String)
Dim dHighDate As Date
Dim sHighPrice As Single
Dim iCounter As Integer
Dim sTestPrice As Single
sHighPrice = xlq(Symbol, "close", sDate)
dHighDate = tDate
dHighDate = dHighDate + 1
For counter = dHighDate To Date
sTestPrice = xlq(tSymbol, "close", Str(dHighDate))
If sTestPrice > sHighPrice Then
sHighPrice = sTestPrice
dHighDate = iCounter
End If
Next iCounter
TestHigh = sHighPrice
End Function
When i run the function its not even going into the for loop. Any
Ideas?