ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Change Cell Border Colors (https://www.excelbanter.com/excel-discussion-misc-queries/221199-change-cell-border-colors.html)

That70sHeidi

Change Cell Border Colors
 
I have a very complicated form with merged cells, thick and thin lines,
dashes, etc. However, someone put all these borders in Navy!

How can I switch the whole document's border colors en masse?

Rick Rothstein

Change Cell Border Colors
 
This macro will change **every** cell with a border color to the new color
you designate...

Sub ChangeBorderColors()
Dim C As Range
Dim WS As Worksheet
For Each WS In Worksheets
For Each C In WS.UsedRange
If C.Borders.ColorIndex < xlColorIndexNone Then
C.Borders.ColorIndex = 3
End If
Next
Next
End Sub

Change the example color index of 3 that I used (inside the If..Then block)
to the color index that you want **all** your existing borders set to.

--
Rick (MVP - Excel)


"That70sHeidi" wrote in message
...
I have a very complicated form with merged cells, thick and thin lines,
dashes, etc. However, someone put all these borders in Navy!

How can I switch the whole document's border colors en masse?




All times are GMT +1. The time now is 05:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com