this should do it i think:
Sub test()
inarr = Range(Cells(1, 1), Cells(25, 7))
' go through the rows
For i = 1 To 24
' go through the columns
For j = 1 To 7
If IsNumeric(inarr(i, j)) Then
' single value on top
If IsNumeric(inarr(i + 1, j)) Then
' single value on bottom
found1 = (Abs(inarr(i, j) - inarr(i + 1, j))) = 1
If found1 Then
Cells(i, j).Interior.ColorIndex = 4
End If
Else
' singel on top multiple on bottom
botarr = Split(inarr(i + 1, j), ",")
For kk = 0 To UBound(botarr)
found1 = (Abs(inarr(i, j) - botarr(kk))) = 1
If found1 Then
Cells(i, j).Interior.ColorIndex = 4
End If
Next kk
End If
' multiple on top
Else
toparr = Split(inarr(i, j), ",")
found1 = False
For k = 0 To UBound(toparr)
' check lower value
If IsNumeric(inarr(i + 1, j)) Then
' single value
found1 = (Abs(toparr(k) - inarr(i + 1, j))) = 1
If found1 Then
Cells(i, j).Interior.ColorIndex = 4
End If
Else
botarr = Split(inarr(i + 1, j), ",")
For kk = 0 To UBound(botarr)
found1 = (Abs(toparr(k) - botarr(kk))) = 1
If found1 Then
Cells(i, j).Interior.ColorIndex = 4
End If
Next kk
End If
Next k
End If
Next j
Next i
End Sub
If you want it to apply to just part of the sheet, just change the range in the :
inarr = Range(Cells(1, 1), Cells(25, 7))
statement