Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to recalculate only a cell or a range in VBA

Tags:

excel

vba

is it possible to recalculate only a cell or a range in VBA ? What I like to use for a sheet is the following, but how to do it on a cell only ? Or range ?

'    ActiveSheet.EnableCalculation = False
'    ActiveSheet.EnableCalculation = True
like image 248
BuZz Avatar asked Dec 01 '11 13:12

BuZz


1 Answers

There is a calculate method you can call on ranges:

Range("A1").Calculate

Try it out by putting =Now() in A1 and running Calculate and watch it update the seconds :) You can for a recalc of all the cells in a sheet by using:

Sheets(1).Calculate

See also: Microsoft MSDN, Excel Recalculation, 16 July 2012.

like image 172
aevanko Avatar answered Sep 19 '22 09:09

aevanko