In fact, you should probably declare the worksheet, which I forgot to do also.
Code Change:
Sub spwolfe()
Dim ws As Worksheet, Prcnt As Double, Ttl As Double
Dim LRng As Variant, HRng As Variant, TtlRng As Variant, cl As Variant
Set ws = Sheets(6) ''Change this to your sheet. If it has a name, Set ws = Worksheets("WorksheetName")
With ws
If .Range("M1").Value = "" Then Set LRng = .Range("M1").End(xlDown)
Set HRng = .Range("M10000").End(xlUp)
Set TtlRng = Range(LRng, HRng)
For Each cl In TtlRng
If cl.Value >= (cl.Offset(0, 1).Value - (cl.Offset(0, 1).Value * 0.1)) And _
cl.Offset(0, 2).Value >= (cl.Offset(0, 1).Value = (cl.Offset(0, 1).Value * 0.1)) Then
cl.EntireRow.Interior.ColorIndex = 8
Else: cl.EntireRow.Interior.ColorIndex = xlNone
End If
Next cl
End With
End Sub
Bookmarks