Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2007

Tip: Looking for answers? Try searching our database.

function result is not propery passed to excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nico - 09 Oct 2007 12:43 GMT
Hi,
I have this weird problem.
I have written a function to calculate how many days, hours & minutes people
in my business work. In the VBA editor the function result is correct, but
when I go to Excel the function returns the wrong value.
The code below is where the problem lies:
Public Function AantalInTijd(Datum As Date, tijdformaat As Tijd) As LongIf
tijdformaat = Minuut Then
If tijdformaat = Minuut Then
   AantalInTijd = Minute(Datum)
End If
End Function

Now when I check the value of AantalInTijd when it gets its value, it says
40. So when I exit the function, it has that value. Now when I go to
Excel(2003), the function has returned 9 instead of 40. Can anyone help me
with this?

Kind regards,
Nico.
Niek Otten - 09 Oct 2007 14:22 GMT
Hi Nico,

Your function seems to be corrupted somewhat when pasted into your post.
Can you resend?
What is the value of Minuut and how is it declared?
You didn't really dim tijdformaat as "tijd", did you?
What were the input values?
What if tijdformaat is *not* Minuut?

Signature

Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi,
| I have this weird problem.
[quoted text clipped - 16 lines]
| Kind regards,
| Nico.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.