Hi,
I'm trying to write a process that will check each cell in column F to make sure it is Zero but for some reason it falls over;
My code is;
Sub Step_one()
Dim FName As Variant
Dim wb As Workbook
Dim lrow As Long, i As Long, j As Long, startrange As Long, endrange As Long
Dim Sh As Worksheet
Dim Counter As Long
Const pwd = "IRSS_Protect"
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
With Sheets("sheet1")
.Unprotect pwd
For Each cel In .Range("F")
On Error Resume Next
If Round(cel.Value, 2) <> 0 Then
Counter = Counter + 1
End If
On Error GoTo 0
Next cel
.Protect Password:=pwd, AllowFiltering:=True
End With
End Sub
Does anyone why this wouldn't work
Bookmarks