+ Reply to Thread
Results 1 to 2 of 2

UDF in User Form

  1. #1
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    UDF in User Form

    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

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Goo afternoon vandanavai

    Yes, you can, you just have to reference it slightly differently. Something like this should work OK :

    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1