I am trying to format a region in a worksheet.
I am using the Worksheet_Change so that it always updates on a change.
My goal is to look at all the cells in a region. If the current cell is empty and the cell to the left has numerical value 0, then I want to enter text "N/A" in the current cell.
My attempt is failing as the Offset cannot be used.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim updateCells As Range
Dim myCell As Range
Set updateCells = Range("B1:M1000")
For Each myCell In updateCells
' NEXT LINE WRONG!!
If myCell.Offset(0, -1).Value = 0 Then
myCell.Interior.ColorIndex = 4
End If
Next
End Sub
Any guidance would be appreciated.
Offset(-1, 0)is looking at the cell above not to the leftOffset(0,-1)