I would like to know if UDF ( User Defined Function ) can be included in User Form code ? I have very simple UDF called 'IndexValue' mentioned below. I have text box called as 'MyDate' in User Form. I want to use UDF in User Form.

Please guide

Function IndexValue(MyDate)

If MyDate > 29676 And MyDate <= 30041 Then
IndexValue = "100"
ElseIf MyDate > 30041 And MyDate <= 30406 Then
IndexValue = "109"
ElseIf MyDate > 30406 And MyDate <= 30772 Then
IndexValue = "116"
Else
IndexValue = "???"
End If
End Function