My (old) function that I wrote doesn't work anymore!

J

Jimmy

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
 
P

Patrick Molloy

worked exactly as is for me O/SX Pro & excel xp

make sure that you have it in a standard Module, ie NOT in a sheet's code
page nor in a class module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top