All of my cells including merged have borders colour of black, default. Is there a Vb routine I can write to detect existing colour and repaint it with a new colour.
Thanks
All of my cells including merged have borders colour of black, default. Is there a Vb routine I can write to detect existing colour and repaint it with a new colour.
Thanks
This routine will check the top border of the active cell to see if it has a color and then will change it to your liking.
Sub ChangeBorder()
Dim cell As Range
Dim myColor as Integer
Set cell = ActiveCell
myColor = 3 'Red
If cell.Borders(xlEdgeTop).ColorIndex >= 1 Then
cell.Borders(xlEdgeTop).ColorIndex = myColor
cell.Borders(xlEdgeBottom).ColorIndex = myColor
cell.Borders(xlEdgeLeft).ColorIndex = myColor
cell.Borders(xlEdgeRight).ColorIndex = myColor
End If
End Sub
HTH
Jason
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks