My worksheet has a range of cells where "some" have a colored border. I had created a subroutine to clear the border colors for the entire range. Now, I need to change it to remove only the border colors where the colorindex = 4.
Here is the subroutine for removing the colorindex. Is there simple way to check each cell? Maybe the "for each" loop?
Thanks for any suggestions!
Here is the subroutine for removing the colorindex. Is there simple way to check each cell? Maybe the "for each" loop?
Code:
Sub UnsetCellBorderByRange(ByVal sWSheet As String, ByVal rRange As Range)
rRange.Borders(xlDiagonalDown).LineStyle = xlNone
rRange.Borders(xlDiagonalUp).LineStyle = xlNone
rRange.Borders(xlEdgeLeft).LineStyle = xlNone
rRange.Borders(xlEdgeTop).LineStyle = xlNone
rRange.Borders(xlEdgeBottom).LineStyle = xlNone
rRange.Borders(xlEdgeRight).LineStyle = xlNone
rRange.Borders(xlInsideVertical).LineStyle = xlNone
rRange.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub 'UnsetCellBorderByRange
Thanks for any suggestions!