+ Reply to Thread
Results 1 to 2 of 2

UDF w/ 2 Condition: How?

Hybrid View

  1. #1
    Registered User
    Join Date
    02-26-2004
    Location
    philippines
    Posts
    73

    UDF w/ 2 Condition: How?

    Guys,

    I'm kind of a dead end with this function I'm trying to make.
    The test data is 1/2/2007. If it falls between 1/1/2007 and 1/5/2007. It will display Week1. I've made the code below but its not working.

    Anyone knows what's wrong with my code?


    Function WeekDays(ByRef Givenday As Date)
    If WeekDays = Givenday >= 1/1/2007 and Givenday<= 1/5/2007 Then
    WeekDays = "Week1"
    End If
    End Function

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try

    Function WeekDays(ByRef Givenday As Date)
    If Givenday >= "1/1/2007" And Givenday <= "1/5/2007" Then
    WeekDays = "Week1"
    End If
    End Function

+ 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