Number Sequence

  • Thread starter Thread starter smandula
  • Start date Start date
S

smandula

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
 
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
 
Using Conditional Formatting and your example...
Highlight Rows 1 and 2.
FORMAT / CONDITIONAL FORMATTING...

Condition 1:
Formula is
=A1=IV1+1
Select the format desired

ADD

Condition 2:
Formula is
=A1=B1-1
Select the format desired


HTH,
 
One way:

Select Column A. Enter the following CF:

CF1: Formula is =B1-A1=1
Format1: Grey


Select Column F. Enter this CF:

CF1: Formula is =F1-E1=1
Format1 Grey

Select columns B:E, apply these CF:

CF1: Formula is =C1-B1=1
Format1: Grey
CF2: Formula Is =D1-C1=1
Format2: Grey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top