Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Defined Functions

I have a function that can increase the price of an item
based on it's weight and current cost of material. I now
need to add a "RoundUp" portion to the function. Can I
use a function "inside" another one?????
TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default User Defined Functions


-----Original Message-----
I have a function that can increase the price of an item
based on it's weight and current cost of material. I now
need to add a "RoundUp" portion to the function. Can I
use a function "inside" another one?????
TIA
.
Yes, you certainly can.. I have done it many times..

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default User Defined Functions

Are we talking Excel or VBA. If Excel, that is not a problem, For instance

=IF(A10, ROUNDUP(A1,0), B1)

Similarly, in VBA, it could be

Function abc(rng As Range)

If rng(1, 1).Value 0 Then
abc = WorksheetFunction.RoundUp(rng, 0)
Else
abc = rng.Offset(0, 1).Value
End If

End Function

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"KMcNelson" wrote in message
...
I have a function that can increase the price of an item
based on it's weight and current cost of material. I now
need to add a "RoundUp" portion to the function. Can I
use a function "inside" another one?????
TIA



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default User Defined Functions

Hello

You can use the worksheet roundup function in a UDF. See
below.

Function SPrice(Weight As Double, MatCost As Double) As
Double
SPrice = Application.WorksheetFunction.RoundUp(Weight *
MatCost, 0)
End Function

Regards
Peter
-----Original Message-----
I have a function that can increase the price of an item
based on it's weight and current cost of material. I now
need to add a "RoundUp" portion to the function. Can I
use a function "inside" another one?????
TIA
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default User Defined Functions

Thanks Peter! It worked great and now I can move on!!!!
-----Original Message-----
Hello

You can use the worksheet roundup function in a UDF. See
below.

Function SPrice(Weight As Double, MatCost As Double) As
Double
SPrice = Application.WorksheetFunction.RoundUp(Weight

*
MatCost, 0)
End Function

Regards
Peter
-----Original Message-----
I have a function that can increase the price of an

item
based on it's weight and current cost of material. I

now
need to add a "RoundUp" portion to the function. Can I
use a function "inside" another one?????
TIA
.

.



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
User defined functions without using VBA. [email protected] New Users to Excel 0 June 13th 06 05:55 PM
User defined functions without using VBA. [email protected] Excel Discussion (Misc queries) 0 June 13th 06 05:50 PM
User Defined Functions Mike McLellan Excel Worksheet Functions 2 May 4th 06 10:56 AM
User Defined Functions Jeff B Excel Worksheet Functions 1 April 27th 05 09:59 PM
User Defined Functions Frank@shell Excel Worksheet Functions 3 April 20th 05 02:41 PM


All times are GMT +1. The time now is 01:42 PM.

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

About Us

"It's about Microsoft Excel"