I'm trying to write a VBA function for converting Declination & Right Ascension to their decimal values.
I have a perfectly working function for the RA but keep getting an
Argument not Optional
error.
The function is currently:
Public Function dec2decimal(Deg As Integer, Min2 As Integer, Sec2 As Integer) As Double
Dim Dec As Double
Dec = 0
If Deg >= 0 Then
Dec = (Deg + Min2 / 60 + Sec2 / 3600)
Else
Dec = (Deg - Min2 / 60 - Sec2 / 3600)
End If
ra2decimal = Dec
End Function
I'm obviously supplying it three arguements when I run it but its still not happy.
Any ideas?