tropicbliss
New Member
- Joined
- Oct 30, 2022
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
I am making a function that requires the use of the TREND() function in Excel. However when I pass an Integer to the third parameter of the function, a #VALUE! error occurs.
I know that the TREND() function accepts the Variant data type. I tried casting the Integer into a Variant using CVar() but it does not work.
Does anybody know how do I fix this issue?
I know that the TREND() function accepts the Variant data type. I tried casting the Integer into a Variant using CVar() but it does not work.
Does anybody know how do I fix this issue?
Excel Formula:
Function TEST()
Dim aY(1 To 2) As Double
Dim aX(1 To 2) As Double
aY(1) = 4000: aY(2) = 20000
aX(1) = 0.3: aX(2) = 0.32
TEST = Application.Trend(aY, aX, 5)(1)
End Function