Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default Return value for a function.

Hi,

My function returns an integer and I want it to return the double value.


Sub testFunction()
dim x7 as double

x7 = 6543.54384
X3 = MaxValue(55, x7)
'but X3 = 6544 not 6543.54384 like I want

Function MaxValue(a, b)

If a < b Then
MaxValue = b
Else
MaxValue = a
End If

End Function
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 921
Default Return value for a function.

Whoops, I forgot X3 was an integer. Just ignore this post, sorry!

"Jeff" wrote:

Hi,

My function returns an integer and I want it to return the double value.


Sub testFunction()
dim x7 as double

x7 = 6543.54384
X3 = MaxValue(55, x7)
'but X3 = 6544 not 6543.54384 like I want

Function MaxValue(a, b)

If a < b Then
MaxValue = b
Else
MaxValue = a
End If

End Function

Reply
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
If function returns #REF!, want it to return 0 rancher fred Excel Worksheet Functions 2 January 6th 07 04:18 AM
Why does this function NOT return a value? Nooby Excel Discussion (Misc queries) 3 May 22nd 06 03:07 PM
Only do Sum function if not "0", IF"0" then return "0" Mike Punko Excel Worksheet Functions 1 June 1st 05 12:20 AM
Function to return value from each tab Steven Leuck Excel Worksheet Functions 1 March 3rd 05 04:11 AM
Function to look at two cells and return a third jlmam Excel Worksheet Functions 2 January 26th 05 04:41 PM


All times are GMT +1. The time now is 08:36 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"