Hi members,

I have below code which borders entire row of the selected cell temporary. I want small change -instead of entirerow border, I want border from a column to R column-

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
   On Error Resume Next
       If Target.Row <> Me.Range("CZ5000").Value Then
            If Application.CutCopyMode = 0 Then
                Cells.Borders.LineStyle = 0
                 For i = 8 To 9
                    With Target.EntireRow.Borders(i)
                          .LineStyle = 1
                          .Weight = xlThin
                    End With
                 Next
            End If
        End If
    On Error GoTo 0
End Sub
I want change something like this.
replace
With Target.EntireRow.Borders(i)
to this
With Range(Cells(Target.Row, "a") & ":" & Cells(Target.Row, "r")).Rows.Borders(i)
Regards,
Nandkumar S.