Active Cell Border Color

L

Linda Oshkosh WI

I know this can be done, I just can remember how or seem to be able to find
it under help.

I would like the border around my active cell to be a different color so it
stands out easier than the now black border on an all black text document. I
know how to add borders to cells, but I need the active cell border than
moves to change color. Please help if you know how to do this!

Thanks.
 
G

Gary''s Student

Put the following Event macro in the worksheet code area:

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


REMEMBER: the worksheet code area, not a standard module.
 
S

Steve Iommi

Your event macro works well with single cells..thank you!

How might one get all boarders of merged cells to change color?



GarysStuden wrote:

RE: Active Cell Border Color
13-Mar-08

Put the following Event macro in the worksheet code area

Private Sub Worksheet_SelectionChange(ByVal Target As Range
Dim v As Varian
v = Array(xlEdgeBottom, xlEdgeTop, xlEdgeRight, xlEdgeLeft
For Each r In ActiveSheet.UsedRang
With
For i = 0 To
.Borders(v(i)).LineStyle = xlNon
Nex
End Wit
Nex

For i = 0 To
With ActiveCell.Borders(v(i)
.LineStyle = xlContinuou
.Weight = xlThic
.ColorIndex =
End Wit
Nex
End Su

REMEMBER: the worksheet code area, not a standard module
--
Gary''s Student - gsnu20077

:

Previous Posts In This Thread:

Active Cell Border Color
I know this can be done, I just can remember how or seem to be able to find
it under help

I would like the border around my active cell to be a different color so it
stands out easier than the now black border on an all black text document. I
know how to add borders to cells, but I need the active cell border than
moves to change color. Please help if you know how to do this!

Thanks.

RE: Active Cell Border Color
Put the following Event macro in the worksheet code area

Private Sub Worksheet_SelectionChange(ByVal Target As Range
Dim v As Varian
v = Array(xlEdgeBottom, xlEdgeTop, xlEdgeRight, xlEdgeLeft
For Each r In ActiveSheet.UsedRang
With
For i = 0 To
.Borders(v(i)).LineStyle = xlNon
Nex
End Wit
Nex

For i = 0 To
With ActiveCell.Borders(v(i)
.LineStyle = xlContinuou
.Weight = xlThic
.ColorIndex =
End Wit
Nex
End Su

REMEMBER: the worksheet code area, not a standard module
--
Gary''s Student - gsnu20077

:


Submitted via EggHeadCafe - Software Developer Portal of Choice
MSChart For VB.Net
http://www.eggheadcafe.com/tutorial...4dc6-9aa7-4f6246763650/mschart-for-vbnet.aspx
 

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