Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Number Sequence

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Number Sequence

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,
--
Gary Brown



"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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Number Sequence

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





In article ,
"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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Number Sequence

Thanks very much for the solutions.



Reply
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
Looking for next number in sequence Alex.W Excel Discussion (Misc queries) 3 January 30th 09 12:40 AM
Row Number out of Sequence JudithJubilee Excel Discussion (Misc queries) 3 October 1st 08 02:15 PM
How can I match a random number with closest number from sequence? Matt Excel Worksheet Functions 4 August 3rd 06 01:22 AM
Number sequence Brento Excel Discussion (Misc queries) 3 July 15th 06 11:41 PM
Next Number in Sequence Mr M Walker[_2_] Excel Programming 3 May 2nd 05 06:29 PM


All times are GMT +1. The time now is 03:28 PM.

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

About Us

"It's about Microsoft Excel"