LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Sequence Part Two

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

9 & 10 are in sequence across columns in row 1
So are 3 & 4 in sequence in row 2
9 & 10 are in sequence in row 3

Once the sequence has been identified, 9 & 10; 3 & 4; 9 & 10
only 9 & 10 they would be highlighted by a color such as grey,
based on the required number 9

Kindly a solution was provided for all sequences, which
worked well. A refined search based on a required number
only, such as number 9. So only sequences in this case
numbers 9 & 10 would be highlighted. It could be another
number such as 1 for sequence 1 & 2 the next time around.

If the above is not possible, then to highlight number 9 with a darker
gray color, making the 9 in 9 & 10 more outstanding.

Sub Look()
Dim x As Range
With Sheets("Sheet 1")
Set x = .Range(.Range("A1"), .Range("F3"))
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

End Sub

If someone could kindly refine the above solution.

With thanks in advance





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Part 2 - Counting series of text/number sequence andrew Excel Discussion (Misc queries) 3 July 22nd 08 03:52 AM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Capturing a word sequence as part of a text in a spreadsheet cell T.Mad Excel Worksheet Functions 4 July 3rd 07 12:08 PM
2 part macro question (sequence & order) Kevin Excel Worksheet Functions 5 March 1st 07 10:08 PM
Indicate missing number in a sequence (Part II) mmock Excel Discussion (Misc queries) 3 February 22nd 06 07:13 PM


All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"