I know that in Excel one can use "rand()" function to generate random numbers, and each time pressing F9, all "rand()" results on that sheet will be refreshed.
However, now I need to repeated generate random numbers using vba, and control it so that the random numbers won't refresh unless the code orders so.
For example i have
- range A1~A100, where i'd like to generate random numbers;
- column B are the calculation place where some calculation by excel "Solver" function is executed by vba;
- column C is where I would like to record 1,000 times calculation, each time from column B;
- the final result is an average value of column C.
Now my problems are
- I don't know how to refresh cells in column A, using vba?
- I notice that, during the vba solver function, as cells in column B are updated, each time updating, the column A random numbers are refreshed -- how could i suppress this?