T
TheIrishThug
i'm writing a conversion rate function. since converstion rates change
everyday. i want to be able to update the macro. it doesn't need to be
extremely accurate, just make sure that if its been, say a week, that
the program will ask me to reset the conversion rate. this is going to
be run alot so i'd rather not have the user input it everytime.
i was thinking something along the lines of:
Function ConvertEuro(WholeLine As String) As Double
Dim DateUpdated As Date
Dim ConverstionRate As Double
DateUpdated = 12/29/05
ConversionRate= 1.81
if Now()-DateUpdated > [one week] then
[at this point it probably needs to break the function and then call a
sub that will alter the function. altering "DateUpdated = 12/29/05" to
"DateUpdated = NOW()" and "ConversionRate= 1.81" to "ConversionRate=
newRate" where newRate is the new rate that the user inputed. and then
the sub would restart ConvertEuro]
end if
ConvertEuro = ConversionRate * CDbl(WholeLine)
end function
everything in []'s is what i need help coding. thanks
everyday. i want to be able to update the macro. it doesn't need to be
extremely accurate, just make sure that if its been, say a week, that
the program will ask me to reset the conversion rate. this is going to
be run alot so i'd rather not have the user input it everytime.
i was thinking something along the lines of:
Function ConvertEuro(WholeLine As String) As Double
Dim DateUpdated As Date
Dim ConverstionRate As Double
DateUpdated = 12/29/05
ConversionRate= 1.81
if Now()-DateUpdated > [one week] then
[at this point it probably needs to break the function and then call a
sub that will alter the function. altering "DateUpdated = 12/29/05" to
"DateUpdated = NOW()" and "ConversionRate= 1.81" to "ConversionRate=
newRate" where newRate is the new rate that the user inputed. and then
the sub would restart ConvertEuro]
end if
ConvertEuro = ConversionRate * CDbl(WholeLine)
end function
everything in []'s is what i need help coding. thanks