I am having trouble writing some code in VBA that will run a macro for all of the sheets in an active workbook without 'manually' selecting the sheets each time and then running the method again. What I currently have is as follows:
sub NhlStatsHighlighter()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws
For Each cell In ActiveSheet.UsedRange.Cells
If IsNumeric(cell) And Not IsEmpty(cell) Then
If cell.Value < 0 Then
cell.Interior.Color = rgbRed
ElseIf cell.Value = 0 Then
cell.Interior.Color = rgbGray
ElseIf cell.Value > 0 Then
cell.Interior.Color = rgbLightBlue
End If
End If
Next
End With
Next ws
This only works on the first (active) sheet. I am not quite sure what I am doing wrong. I have tried other approaches, but I run into the same problem.