ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Re-execute all UDF programmatically (https://www.excelbanter.com/excel-programming/357183-re-execute-all-udf-programmatically.html)

Peter

Re-execute all UDF programmatically
 
Hi,

I'd like to know how I can loop through all Formula / UDF in all worksheets
in a workbook programmatically? Do SpecialCells be useful here? Do the
returned Ranged (by SpecialCells) contains multiple range?

TIA.

Peter

Re-execute all UDF programmatically
 
Thanks Gary, is there a way to loop and touch every formula throughout the
workbook? I want to make sure all formulae are touched, under my certain
criteria .

Thanks,

"Gary''s Student" wrote:

Try:

Sub macx()
Dim w As Worksheet
For Each w In ActiveWorkbook.Worksheets
w.Activate
ActiveSheet.Calculate
Next w
End Sub

--
Gary''s Student


"Peter" wrote:

Hi,

I'd like to know how I can loop through all Formula / UDF in all worksheets
in a workbook programmatically? Do SpecialCells be useful here? Do the
returned Ranged (by SpecialCells) contains multiple range?

TIA.


Charles Williams

Re-execute all UDF programmatically
 
You need to use Application.Calculatefull not sheet.calculate.

see http://www.decisionmodels.com/calcsecretsh.htm for more details on using
the various calculate methods from VBA.

see also http://www.decisionmodels.com/calcsecretsj.htm for advice on
writing UDFs.

Charles
______________________
Decision Models
FastExcel 2.2 Beta now available
www.DecisionModels.com

"Peter" wrote in message
...
Thanks Gary, is there a way to loop and touch every formula throughout
the
workbook? I want to make sure all formulae are touched, under my certain
criteria .

Thanks,

"Gary''s Student" wrote:

Try:

Sub macx()
Dim w As Worksheet
For Each w In ActiveWorkbook.Worksheets
w.Activate
ActiveSheet.Calculate
Next w
End Sub

--
Gary''s Student


"Peter" wrote:

Hi,

I'd like to know how I can loop through all Formula / UDF in all
worksheets
in a workbook programmatically? Do SpecialCells be useful here? Do the
returned Ranged (by SpecialCells) contains multiple range?

TIA.





All times are GMT +1. The time now is 10:19 AM.

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