can someone help me with this code?
Function DayOfyear(Optional dteDate As Date) As Long
If CLng(dteDate) = 0 Then
dteDate = Date
End If
DayOfyear = Abs(DateDiff("d", dteDate, DateSerial(Year(dteDate) - 1, 6, 30)))
End Function
Sub Test()
MsgBox (DayOfyear * 0.0547945)
End Sub
in the day of year = abs....... i need the 1,6,30 to be entered by an input box or somethin like that. this is the date that the function runs off. but i need to be able to enter it?
anyideas?
Function DayOfyear(Optional dteDate As Date) As Long
If CLng(dteDate) = 0 Then
dteDate = Date
End If
DayOfyear = Abs(DateDiff("d", dteDate, DateSerial(Year(dteDate) - 1, 6, 30)))
End Function
Sub Test()
MsgBox (DayOfyear * 0.0547945)
End Sub
in the day of year = abs....... i need the 1,6,30 to be entered by an input box or somethin like that. this is the date that the function runs off. but i need to be able to enter it?
anyideas?