LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default UDF behaving oddly

The following UDF generates VALUE! errors intermittently and I can't figure
out why. The range argument references another (shared) workbook. It seems
that when this shared workbook is open the function works, when it is not
open, the error is generated. Can this be corrected?

Thanks



Public Function DTD(TIME As Range, CONVTYPE As Integer)

Select Case CONVTYPE

Case Is = 1
minutes = Int(TIME)
seconds = Round((TIME - minutes) * 60, 0)
DTD = TimeSerial(0, minutes, seconds)
Case Is = 2
minutes = Int(TIME)
seconds = (TIME - minutes) / 0.6
DTD = minutes + seconds

End Select

End Function
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find works very oddly chfa Excel Programming 2 May 3rd 07 08:56 PM
Select Case Behaving Oddly Kris_Wright_77 Excel Programming 3 June 6th 06 07:06 PM
OFFSET behaving oddly Ryan Poth Excel Worksheet Functions 2 May 30th 06 07:29 AM
=ISODD Behaving Oddly Craig[_15_] Excel Programming 5 April 30th 04 08:59 PM


All times are GMT +1. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"