Change cell selection border color in excel to stand out more?

J

Jeanne

Is it possible to change the working cell border color as you move around in
your spreadsheet to find your place easily?
 
R

ryguy7272

Take a look at this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim v As Variant
v = Array(xlEdgeBottom, xlEdgeTop, xlEdgeRight, xlEdgeLeft)
For Each r In ActiveSheet.UsedRange
With r
For i = 0 To 3
..Borders(v(i)).LineStyle = xlNone
Next
End With
Next

For i = 0 To 3
With ActiveCell.Borders(v(i))
..LineStyle = xlContinuous
..Weight = xlThick
..ColorIndex = 7
End With
Next
End Sub



Right-click on the tab and paste the code into the window that opens.


Regards,
Ryan---
 
D

Dave Peterson

I think I'd use Target instead of activecell. And instead of activesheet, I'd
refer to it using the Me keyword. And declaring all the variables you use is
always a good idea.

Did you mean to post this as a followup to my response? Was it meant for the
OP?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top