Code:
Sub AllGood6()
ActiveSheet.Unprotect ("as")
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim r As Range
Dim s As Range
If UserForm6.TextBox1 > 0 Then
For Each r In Range("H26:H35")
[B]For Each s In Range("A26:A35")
[/B] If r.Value > 0 And s.Value > 0 Then
r.Value = r.Value - ((r.Value * UserForm6.TextBox1.Value) / 100) / [B]s.Value
[/B]
Next r
Unload UserForm6
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
ActiveSheet.Protect ("as")
End Sub
Im trying to count the number of cells in A26:A35 > 0, taking that number and dividing it into the r.value.