Werner Alber
Werner Alber

Reputation: 1

How to execute formula in cell (row,col) from vba routine

being a freshman with regard to Excel, here is what I would like to achieve:

In cell(row,col) there is a worksheet function, in this case RANDARRY(rows;cols;min;max;TRUE). I now would like to write a vba routine that simply executes whatever is written in cell(row,col).

Upvotes: 0

Views: 453

Answers (1)

Pᴇʜ
Pᴇʜ

Reputation: 57673

Worksheet("Sheet1").Calculate should recalculate all the formulas on the sheet.

Worksheet("Sheet1").Range("A1:A10").Calculate should recalculate the formulas in range A1 to A10 in Sheet1.

Alternatively pushing F9 does trigger calculation without using VBA.

Upvotes: 1

Related Questions