my code is here:

Function CINTERVAL(xvalues As Variant, yvalues As Variant, t)

'Pre-define variables

Dim n As Integer

Dim syx As Variant

Dim average As Variant

Dim ssx As Variant

Dim i As Integer

Dim x As Variant

'Perform Calculations

syx = WorksheetFunction.StEyx(yvalues, xvalues)

average = WorksheetFunction.average(xvalues)

ssx = WorksheetFunction.DevSq(xvalues)

n = WorksheetFunction.Count(xvalues)

x = xvalues.Value

'Store Values in an Array

For i = 1 To UBound(x)

CI.Value(i) = t * syx * (1 / n + (WorksheetFunction.Index(x, i) - average) ^ 2 / ssx ^ 2) ^ (1 / 2)

Next i

'Output Array

CINTERVAL = CI.Value

End Function

If anyone knows what I'm doing wrong i'd be soooo appreciative.