Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've defined a function in VBA to randomly generate a
number "close to" its argument. It uses a formula on a hiden sheet, which gives a random number between 0.666 and 1.333 to multiply the argument by. Function Near(Actual) Sheets("hiden").Cells.Calculate Near = Actual * Sheets("hiden").Cells(1, 1) End Function Sub test() Sheets("hiden").Cells(1, 1) _ .FormulaR1C1 = "=(rand()-0.5)/3+1" MsgBox Near(100) End Sub The test procedure above works, but if I enter the formula "=near(100)" into a cell on my worksheet and fill the formula down a few rows, it doesn't calculate the values. Does anyone know why this is? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cant calculate sum function | Excel Discussion (Misc queries) | |||
Calculate function Xx+1=rX(1-X). How? | Excel Discussion (Misc queries) | |||
function doesn't calculate | Excel Worksheet Functions | |||
Function Won't Calculate -- Sometimes | Excel Discussion (Misc queries) | |||
How to calculate PMT function | Excel Worksheet Functions |