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

this is kind of ****e but i prefer it to microsofts kb method.

Dim xbar As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

xbar = ActiveCell.Row
ybar = ActiveCell.Column

If Selection.Rows.Count = 1 And Selection.Columns.Count = 1 Then
For f = 1 To 20
With Cells(Application.WorksheetFunction.Max(1, xbar - f), ybar)
If .Borders(xlEdgeLeft).Weight = xlThick Then
With Range("A" & Application.WorksheetFunction.Max(1, xbar - f) & ":BE" & _
Application.WorksheetFunction.Max(1, xbar - f))
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
End If
End With
Next
For f = 1 To 20
With Cells(xbar + f, ybar)
If .Borders(xlEdgeLeft).Weight = xlThick Then
With Range("A" & xbar + f & ":BE" & xbar + f)
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
End If
End With
Next
curr_row = ActiveCell.Row

With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeLeft)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeTop)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeBottom)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeRight)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlInsideVertical)
.Weight = xlThick
End With

End If

ActiveCell.Borders(xlEdgeRight).ColorIndex = 4
ActiveCell.Borders(xlEdgeTop).ColorIndex = 4
ActiveCell.Borders(xlEdgeLeft).ColorIndex = 4
ActiveCell.Borders(xlEdgeBottom).ColorIndex = 4

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default row highlighter


And the question is?


"numcrun" wrote in message
om...
this is kind of ****e but i prefer it to microsofts kb method.

Dim xbar As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

xbar = ActiveCell.Row
ybar = ActiveCell.Column

If Selection.Rows.Count = 1 And Selection.Columns.Count = 1 Then
For f = 1 To 20
With Cells(Application.WorksheetFunction.Max(1, xbar - f), ybar)
If .Borders(xlEdgeLeft).Weight = xlThick Then
With Range("A" & Application.WorksheetFunction.Max(1, xbar - f) &

":BE" & _
Application.WorksheetFunction.Max(1, xbar - f))
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
End If
End With
Next
For f = 1 To 20
With Cells(xbar + f, ybar)
If .Borders(xlEdgeLeft).Weight = xlThick Then
With Range("A" & xbar + f & ":BE" & xbar + f)
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
End If
End With
Next
curr_row = ActiveCell.Row

With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeLeft)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeTop)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeBottom)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlEdgeRight)
.Weight = xlThick
End With
With Range("A" & curr_row & ":BE" & curr_row).Borders(xlInsideVertical)
.Weight = xlThick
End With

End If

ActiveCell.Borders(xlEdgeRight).ColorIndex = 4
ActiveCell.Borders(xlEdgeTop).ColorIndex = 4
ActiveCell.Borders(xlEdgeLeft).ColorIndex = 4
ActiveCell.Borders(xlEdgeBottom).ColorIndex = 4

End Sub



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
why does the highlighter independently jump to another cell Clinton C Excel Discussion (Misc queries) 0 July 24th 08 12:39 AM
"classic" yellow highlighter ron Excel Discussion (Misc queries) 4 March 7th 08 09:07 AM
highlighter jlm@yell-o-glow Excel Discussion (Misc queries) 1 January 24th 06 05:24 PM
Excel row highlighter I_am_a_MS_user Excel Discussion (Misc queries) 4 October 10th 05 10:58 PM


All times are GMT +1. The time now is 12:21 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"