Das ganze Blatt wird hier mit dem schwarzen Rahmen ausgefüllt.
Wie kann ich nur die Zellen A4 bis L63 mit dem Rahmen ausfüllen, den Rest nicht?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ci1 As Integer, ci2 As Integer
Dim zf1 As Variant, zf1_1 As Variant, zf2 As Variant
ci1 = 36: ci2 = 45
Application.ScreenUpdating = False
ac = ActiveCell.AddressLocal(ColumnAbsolute:=False, RowAbsolute:=False)
'Rows.Interior.ColorIndex = xlNone
'Setzt Rahmenfarbe auf Schwarz
Rows.Borders.ColorIndex = 0
zf1 = Mid(ac, 2, 5)
zf1_1 = IsNumeric(zf1)
If zf1_1 = True Then
Range(Cells(zf1, 1), Cells(zf1, 12)).Borders(xlEdgeBottom).LineStyle = xlContinuos
Range(Cells(zf1, 1), Cells(zf1, 12)).Borders(xlEdgeBottom).Weight = xlThick
Range(Cells(zf1, 1), Cells(zf1, 12)).Borders(xlEdgeBottom).ColorIndex = ci2
Else
zf2 = Mid(ac, 3, 5)
Range(Cells(zf2, 1), Cells(zf2, 1)).Borders(xlEdgeBottom).LineStyle = xlContinuos
Range(Cells(zf2, 1), Cells(zf2, 1)).Borders(xlEdgeBottom).Weight = xlThick
Range(Cells(zf2, 1), Cells(zf2, 1)).Borders(xlEdgeBottom).ColorIndex = ci1
End If
Application.ScreenUpdating = True
End Sub
Grüße und bleibt Gesund
Mike