VBA MOD 01 Project Acvtivity : Count total number of formulas in Workbook
Option Explicit
Public Sub Count_WB_formulas_error_Handling()
Dim Sh As Worksheet
Dim CounterWS As Double
Dim CounterGlobal As Double
For Each Sh In ThisWorkbook.Worksheets
On Error GoTo Errorhandle
CounterWS = Sh.Cells.SpecialCells(xlCellTypeFormulas).Count
Lable1: CounterGlobal = CounterGlobal + CounterWS
Errorhandle:
If Err.Number = 1004 Then
CounterWS = 0
Resume Lable1
End If
Next Sh
MsgBox CounterGlobal
End Sub
Comments
Post a Comment