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

Is it possible to highlight recurrant items from a subject row to
five rows below? When activating any row. In Yellow both the subject
line and any one of the five comparable lines.In VBA.
For Instance

A B C D
1 11 12 13 14
2 1 2 3(y) 4 <---- subject line active
3 9 10 3(y) 33 -|
4 22 23 24 25 | comparables
5 6 7 4(y) 11 -|


With Thanks



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Highlite Items

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Me.Cells.Interior.ColorIndex = xlColorIndexNone
Target.Resize(5).EntireRow.Interior.ColorIndex = 36

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"smandula" wrote in message
...
Is it possible to highlight recurrant items from a subject row to
five rows below? When activating any row. In Yellow both the subject
line and any one of the five comparable lines.In VBA.
For Instance

A B C D
1 11 12 13 14
2 1 2 3(y) 4 <---- subject line active
3 9 10 3(y) 33 -|
4 22 23 24 25 | comparables
5 6 7 4(y) 11 -|


With Thanks





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Highlite Items

Thanks for reply, however I only need numbers 3 and 4 to be highlighted.

These or any other similar Numbers which are the same in the subject line
and 4 other rows.

Thanks for your response. If anyone could further this arguement it would be
appreciated.




"smandula" wrote in message
...
Is it possible to highlight recurrant items from a subject row to
five rows below? When activating any row. In Yellow both the subject
line and any one of the five comparable lines.In VBA.
For Instance

A B C D
1 11 12 13 14
2 1 2 3(y) 4(y) <---- subject line active
3 9 10 3(y) 33 -|
4 22 23 24 25 | comparables
5 6 7 4(y) 11 -|


With Thanks





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Highlite Items

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
Dim i As Long
Dim iPos As Long

Me.Cells.Interior.ColorIndex = xlColorIndexNone
For Each cell In Target.EntireRow.Cells
For i = 1 To 5
iPos = 0
On Error Resume Next
iPos = Application.Match(cell.Value, Rows(Target.Row + i),
0)
On Error GoTo 0
If iPos < 0 Then
Rows(Target.Row + i).EntireRow.Interior.ColorIndex = 36
End If
Next i
Next cell

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"smandula" wrote in message
...
Thanks for reply, however I only need numbers 3 and 4 to be highlighted.

These or any other similar Numbers which are the same in the subject line
and 4 other rows.

Thanks for your response. If anyone could further this arguement it would

be
appreciated.




"smandula" wrote in message
...
Is it possible to highlight recurrant items from a subject row to
five rows below? When activating any row. In Yellow both the subject
line and any one of the five comparable lines.In VBA.
For Instance

A B C D
1 11 12 13 14
2 1 2 3(y) 4(y) <---- subject line active
3 9 10 3(y) 33 -|
4 22 23 24 25 | comparables
5 6 7 4(y) 11 -|


With Thanks







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

Thanks for your instant reply. I can't believe how easy it is for you
to program. The program works nicely for the entire line.

However, it is not a line highlite I need, it's individual similar numbers
on that first line
when compared to the other lines. (y) is marked to indicate yellow.
Thanks for viewing this problem and replying


A B C D
1 11 12 13 14
2 1 2 3(y) 4(y) <---- subject line active first
line
3 9 10 3(y) 33 -|
4 22 23 24 25 | comparable lines
5 6 7 4(y) 11 -|


With Thanks




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Highlite Items

Next try

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
Dim i As Long
Dim iPos As Long

Me.Cells.Interior.ColorIndex = xlColorIndexNone
For Each cell In Target.EntireRow.Cells
For i = 1 To 5
iPos = 0
On Error Resume Next
iPos = Application.Match(cell.Value, Rows(Target.Row + i),
0)
On Error GoTo 0
If iPos < 0 Then 'return_type' is 1
Cells(Target.Row + i, iPos).Interior.ColorIndex = 36
cell.Interior.ColorIndex = 36
End If
Next i
Next cell

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"smandula" wrote in message
...
Thanks for your instant reply. I can't believe how easy it is for you
to program. The program works nicely for the entire line.

However, it is not a line highlite I need, it's individual similar numbers
on that first line
when compared to the other lines. (y) is marked to indicate yellow.
Thanks for viewing this problem and replying


A B C D
1 11 12 13 14
2 1 2 3(y) 4(y) <---- subject line active first
line
3 9 10 3(y) 33 -|
4 22 23 24 25 | comparable lines
5 6 7 4(y) 11 -|


With Thanks




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Highlite Items

Wonderful!

Thanks a million. It is so easy to pick out similar values.


Thanks Again
Steve


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
Dim i As Long
Dim iPos As Long

Me.Cells.Interior.ColorIndex = xlColorIndexNone
For Each cell In Target.EntireRow.Cells
For i = 1 To 5
iPos = 0
On Error Resume Next
iPos = Application.Match(cell.Value, Rows(Target.Row + i),
0)
On Error GoTo 0
If iPos < 0 Then 'return_type' is 1
Cells(Target.Row + i, iPos).Interior.ColorIndex = 36
cell.Interior.ColorIndex = 36
End If
Next i
Next cell

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"smandula" wrote in message
...
Thanks for your instant reply. I can't believe how easy it is for you
to program. The program works nicely for the entire line.

However, it is not a line highlite I need, it's individual similar
numbers
on that first line
when compared to the other lines. (y) is marked to indicate yellow.
Thanks for viewing this problem and replying


A B C D
1 11 12 13 14
2 1 2 3(y) 4(y) <---- subject line active
first
line
3 9 10 3(y) 33 -|
4 22 23 24 25 | comparable lines
5 6 7 4(y) 11 -|


With Thanks






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
is there a highlite option? PATT Excel Discussion (Misc queries) 1 August 30th 07 04:07 PM
Highlite every 2nd row with a colour Ty Excel Discussion (Misc queries) 1 February 6th 06 10:37 PM
Formula please to highlite every second Row. Steved Excel Worksheet Functions 3 January 18th 06 12:14 AM
If then highlite? Steve R Excel Discussion (Misc queries) 1 May 31st 05 11:55 PM
Highlite a row Red Excel Worksheet Functions 1 October 30th 04 10:52 PM


All times are GMT +1. The time now is 01:18 AM.

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"