LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How to change active cell border color in Excel 2007

Hi,

I want to change the active cell border colour to red. I foundthe
following code on the net but as a total newbie to VBA in excel I
haven't got a clue where to put it or how to use it. Can somebody
please help.

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

TIA

Dynamo
 
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
Active Cell Border Color Linda Oshkosh WI Excel Worksheet Functions 2 May 29th 10 09:12 PM
active cell border color mike d Excel Discussion (Misc queries) 1 May 16th 08 10:35 AM
Change cell selection border color in excel to stand out more? Jeanne Excel Worksheet Functions 3 April 11th 08 09:22 PM
On a Mac how do I change the border colour of the active cell? Lino Excel Discussion (Misc queries) 2 May 23rd 06 01:36 PM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM


All times are GMT +1. The time now is 02:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"