Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Reference a Macro to perform Cell formula
Hi,
I was wondering if it is possible to actually make a macro that would perform a math function and then have a cell use that macro to come up with the value that is displayed in the cell? Reason being is that I'm pretty sure I can make a macro that would calculate what I need in my previous post "Desperately needing furmula help" but I'm wondering how I would get the cell to use that macro to get the result. Unless someone has a better idea. Thanks Very Much, in Advance, Fred |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Reference a Macro to perform Cell formula
Write the macro as a function. Check VBA help for user defined functions
(UDF) or "writing a function procedure" - under conceptual topics. Function MyFunction(FirstArgument As Double) As Double MyFunction = FirstArgument * 2 End Function In excel, you would call this example with =myfunction(A1) If A1=5, this function will return 10 (the usage is pretty much the same as any other excel function) "Fred "Djinn" Holstings" wrote: Hi, I was wondering if it is possible to actually make a macro that would perform a math function and then have a cell use that macro to come up with the value that is displayed in the cell? Reason being is that I'm pretty sure I can make a macro that would calculate what I need in my previous post "Desperately needing furmula help" but I'm wondering how I would get the cell to use that macro to get the result. Unless someone has a better idea. Thanks Very Much, in Advance, Fred |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
Is it possible? | Excel Worksheet Functions | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Formula Problem - interrupted by #VALUE! in other cells!? | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |