Thread: Number Sequence
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gixxer_J_97[_2_] Gixxer_J_97[_2_] is offline
external usenet poster
 
Posts: 206
Default Number Sequence

this worked for me:

Dim x As Range
With Sheets("Sheet1")
Set x = .Range(.Range("A1"), .Range("F2"))
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
.ColorIndex = 15
.Pattern = xlSolid
End With
End If
Next


"smandula" wrote:

I would like to obtain numbers that are in sequence in a six column ranges.
Selecting across Columns only not rows.
Such as, A1.. F2
A B C D E F
1 1 12 33 9 10 44
2 0 3 4 13 94 15

9 & 10 are in sequence across columns
So are 3 & 4 in sequence.
Once the sequence has been identified, 9 & 10; 3 & 4,
they would be highlited by a color such as grey,
Any suggestions would be appreciated.

With Thanks in advance