View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default Selective calculate command button & other questions.

select yr cells to be recalculated and use this code:

Sub cus()

Application.Calculation = xlCalculationManual

For Each cell In Selection
cell.Formula = cell.Formula
Next cell

End Sub

Pls click "Yes" if this post helped you



On 23 Gru, 03:54, DangerPayne
wrote:
I have need of a command button that when pressed will calculate the formulas
in a particular group of cells. *Also, if any of the cells in this group are
selected, the button should only calculate the formulas in the selected
cells. *
(It would be nice if the code specified the cells and didn't calculate other
formulas in the spreadsheet.) * *

Here is the example:
I have 5 cells that have a formula that calls random numbers (1-6). *I need
a button that when pressed will calculate the formulas in all 5 of the cells
unless some of these cells are selected, in which case the button will only
calculate the formulas in the selected cells.

Also, is there a way to set some formulas to automatically calculate and
some not to?