every time i run this program in VBE i keep getting the message
'Compile Error: expected array' for the two bold lines underneath, please help?
Public Function KnotsToKmPerHr(knots As Double) As Double
Dim Km As Double
KNOTS_TO_KM = 1.852
Km = knots * KNOTS_TO_KM
KnotsToKmPerHr = Km
End Function
Sub CreateFlightPlan()
Dim row As Integer
Dim col As Integer
Dim dblAirSpeed As Double
Dim dblWindSpeed As Double
Dim angle As Double
Dim angle2 As Double
Dim KnotsToKmPerHr As Double
Dim bearing As Double
Dim direction As Double
Dim beta As Double
Dim alpha As Double
col = COL_LEG_BEARING
row = ROW_FIRST_LEG
KnotsToKmPerHr = 1.852
dblAirSpeed = ActiveSheet.Range(CELL_AIRSPEED) ' in knots
AirSpeed = KnotsToKmPerHr(dblAirSpeed)
dblWindSpeed = ActiveSheet.Cells(row, COL_WIND_SPEED)
WindSpeed = KnotsToKmPerHr(dblWindSpeed)
bearing = ActiveSheet.Cells(row, col).Value
While ActiveSheet.Cells(row, col) <> ""
If bearing >= 0 And bearing < 270 Then
angle = -bearing + 90
ElseIf bearing >= 270 And bearing <= 360 Then
angle = -bearing + 450
End If
direction = ActiveSheet.Cells(row, COL_WIND_DIR).Value
If direction > 0 And direction < 270 Then
angle2 = -direction + 90
ElseIf direction >= 270 And direction < 360 Then
angle2 = -direction + 450
End If
angle2 = angle2 + 90
alpha = angle2 + angle
beta = ArcSin((Sin(alpha) * WindSpeed) / AirSpeed)
row = row + 1
Wend
End Sub