Добрый день, форумчане! Подскажите, в чём может быть проблема, в начале года макрос работал, сейчас отказывается работать
Код |
---|
Sub Zalivka()
Dim x As Range, y As Range, z As Range
Application.ScreenUpdating = False: On Error Resume Next
Set x = Cells.SpecialCells(xlCellTypeConstants, xlNumbers)
Set y = Cells.SpecialCells(xlCellTypeFormulas, xlNumbers)
Set z = Union(x, y)
If x Is Nothing Then Set z = y
If y Is Nothing Then Set z = x
For Each Cell In z
If Cell.Value = 0 Then Cell.Interior.ColorIndex = 2
If Cell.Value = 51 Then Cell.Interior.ColorIndex = 43
Next
Set x = Nothing: Set y = Nothing: Set z = Nothing
End Sub
Sub Ochistka()
Cells.Interior.ColorIndex = xlNone
End Sub
|