Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
is there a highlite option? | Excel Discussion (Misc queries) | |||
Highlite every 2nd row with a colour | Excel Discussion (Misc queries) | |||
Formula please to highlite every second Row. | Excel Worksheet Functions | |||
If then highlite? | Excel Discussion (Misc queries) | |||
Highlite a row | Excel Worksheet Functions |