Habe folgenden Code, der mir die farbig umrandeten Zellen wieder schwarz macht. Das macht der Code auch. Jedoch bleiben alle Zellen danach markiert. Wie kann ich das ändern? Da muss doch nur eine Option geändert werden oder? Ich weiß aber nicht welche.
Call NEW_ROW_MAX
COL_MAX = Worksheets(sheetname).UsedRange.Columns.Count
Range(Cells(1, 1), Cells(NEW_ROW_MAX, COL_MAX)).Select
Application.CommandBars("Borders").Visible = False
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 1
End With
Application.ScreenUpdating = True
Worksheets(sheetname).Activate
Philipp