S
smandula
I have a conflict between c. in Sheet1. with another c.
Is there a substitute for c.
Purpose of this macro is to find pairs of
adjacent value and highlight them in color.
Sub sequence()
With Sheets("Sheet1")
x5 = Range("AE13").Value
x6 = Range("AE14").Value
Set x = .Range("C" & x6 & ":V" & x5)
End With
For Each c In x
If c.Value = (c.Offset(0, 1).Value - 1) Then
Range(c, c.Offset(0, 1)).Select
With Selection.Interior
..Color = RGB(222, 222, 222)
..Pattern = xlSolid
End With
End If
Next
Range("A1").Select
End Sub
With Thanks
Is there a substitute for c.
Purpose of this macro is to find pairs of
adjacent value and highlight them in color.
Sub sequence()
With Sheets("Sheet1")
x5 = Range("AE13").Value
x6 = Range("AE14").Value
Set x = .Range("C" & x6 & ":V" & x5)
End With
For Each c In x
If c.Value = (c.Offset(0, 1).Value - 1) Then
Range(c, c.Offset(0, 1)).Select
With Selection.Interior
..Color = RGB(222, 222, 222)
..Pattern = xlSolid
End With
End If
Next
Range("A1").Select
End Sub
With Thanks