Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No. What you are doing is the way to go. However, if you want for
whatever reasont to use a function, write a user defined function. Put the following in a standard module. Option Explicit Function FractionChange(OldVal As Double, NewVal As Double) FractionChange = (NewVal - OldVal) / OldVal End Function The function is used in a worksheet cell as =FractionChange(C11,D11) where C11 contains the old value and D11 the new. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... Is their an excel function to give rate of increase or decrease between two numbers? the formula i use is (New Amt - Orginal Amt) / Orginal Amt = Increase Thanks Bob Leonard |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
You need to prefix the function name with the workbook name. E.g., =personal.xls!FractionChange(1,2) It is something of a misconception that functions in personal.xls are available to all workbooks, as though there were something special about the workbook. Personal.xls is just a regular workbook, but one that is generally always open. You still need to tell Excel to look there, though. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "rleonard" wrote in message ... Tushar, I put code in a module Personal.xls as Option Explicit! But when I open another worksheet i can not find function FractionChange! How can i fix this so function is available to all my worksheets! Thanks Bob Leonard |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Also make sure it is in a general module and not a sheet module or other
special module like workbook or userform or a class module. You get a general module when you go the vbe and with personal.xls as the active project, do Insert = Module. when you declare the function make it public Public Function FractionChange(rng1 as Range, rng2 as Range) End Function -- Regards, Tom Ogilvy "rleonard" wrote in message ... Tushar, I put code in a module Personal.xls as Option Explicit! But when I open another worksheet i can not find function FractionChange! How can i fix this so function is available to all my worksheets! Thanks Bob Leonard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to calculate next rate increase in weeks | Excel Discussion (Misc queries) | |||
Formula to calcuate next rate increase in #weeks | Excel Discussion (Misc queries) | |||
Cost increase rate | Excel Worksheet Functions | |||
How to pro rate values by date? | Excel Discussion (Misc queries) | |||
Starting payment when increase rate is known & total payment is kn | Excel Worksheet Functions |