انسخ هذا الكود الى حدث الصفحة
Private Sub Worksheet_selectionChange(ByVal Target As Range)
lra = Cells(Rows.Count, 1).End(3).Row + 1
Set myrg = Range("a" & lra).Resize(1, 6)
If Target.Address = Range("a" & lra).Address And Target.Count = 1 Then
If Cells(lra, 1).Offset(-1, 0).Value <> "" Then
With myrg.Borders
.LineStyle = xlDouble
.Color = 682978
End With
End If
End If
End Sub