View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jimmy Jimmy is offline
external usenet poster
 
Posts: 3
Default My (old) function that I wrote doesn't work anymore!

Hi,

I wrote this a few years back for a time tracking sheet I made. I
wanted to use it again and fired it up but.... it's not working in
excel-xp. The function shows that it requires no arguments now, even
though it should require 4. Any help would be appreciated.

here is the snippet: note some lines wrapped....

Option Explicit
Public Function Calcdowntime(ByVal downdate As Long, downtime As Long,
update As Long, uptime As Long) As Long
Dim dd As Long
Dim dt As Long
Dim ud As Long
Dim ut As Long
Dim dm As Long
Dim um As Long
Dim dh As Long
Dim uh As Long
Dim dttm As Long
Dim utfm As Long
Dim days As Long
days = update - downdate
dm = downtime Mod 100
um = uptime Mod 100
dh = Int(downtime / 100)
uh = Int(uptime / 100)
dttm = ((24 - dh) * 60) - dm
utfm = (uh * 60) + um
Calcdowntime = (dttm + utfm) + ((days - 1) * 1440)
End Function

If you have any ideas - please let me know.

Thanks

Jimmy