ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Selective calculate command button & other questions. (https://www.excelbanter.com/excel-discussion-misc-queries/214482-selective-calculate-command-button-other-questions.html)

DangerPayne

Selective calculate command button & other questions.
 
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?


Jarek Kujawa[_2_]

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?




All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com