I'm trying to put borders around a column that starts from a certain cell but I'm getting different error codes for each issue.
Original Code
Sub Borders()
With ThisWorkbook.Worksheets("Sheet1").Range("J16").UsedRange _
.Borders(xlEdgeBottom) _
.LineStyle = XlLineStyle.xlContinuous
End With
End Sub
The code above comes up with a runtime error 438 because the object or the method I have used is incorrect so I tried to rectify it by using the code below.
New Code
Sub Borders()
With ThisWorkbook.Worksheets("Sheet1")
LastRow = .Range("J16" & .Rows.Count).End(xlUp).Row _
.Borders(xlEdgeBottom) _
.LineStyle = XlLineStyle.xlContinuous
End With
End Sub
The second code came up with a 1004 execution error meaning that I've named the range incorrecty, but I'm not sure how.
I was wondering what I could do to fix the issue?
Thanks,