+ Reply to Thread
Results 1 to 3 of 3

Add-Ins ???

  1. #1
    Registered User
    Join Date
    09-16-2005
    Location
    Bangalore, India
    Posts
    47

    Question Add-Ins ???

    My Add-In to Take time out of a Date and Time combination is not working.
    Can some please help me out???

    This is my function:
    Function TM(D As Date)
    If D = 0 Then
    TM = ""
    Else
    TM = TimeSerial(Hour(D), Minute(), Second())
    End If
    End Function

    I've stored this under (I use Microsoft XP):
    C:\Documents and Settings\gb0384\Application Data\Microsoft\AddIns
    and selected the Add-In under Tools\Add-Ins


    My Excel looks like:

    Cell A1 contains "9/1/2005 12:00:04 AM" and
    Cell B1 contains =TM(A1)

    and this gives me a "#NAME?" result


  2. #2

    Re: Add-Ins ???

    Baapi:

    Functions need to return a value, you had actually built a sub()
    procedure. You also forgot to place the Date as "D" in your Minute &
    Second functions. I cleaned it up and this is how it should look...

    'This is my function:
    Function TM(D As Date) As Variant

    If D = 0 Then
    TM = ""
    Else
    TM = TimeSerial(Hour(D), Minute(D), Second(D))
    End If

    End Function


    Now the Function returns the time from the given date as a Serial#.
    You have to format the cell with the correct format to read it as such
    though.


  3. #3
    Registered User
    Join Date
    09-16-2005
    Location
    Bangalore, India
    Posts
    47

    Question RE: Add-Ins

    Even with your function, Its the same result...

+ 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