Selective calculate command button & other questions.

D

DangerPayne

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?
 
J

Jarek Kujawa

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top