I have a macro to total data and then to insert a thick outside border around the last row containing data in Col A & B
The macro is totalling the data correctly, but I get an error pertaining to the code to create a thick outside border
Kindly check & amend my code
The macro is totalling the data correctly, but I get an error pertaining to the code to create a thick outside border
Kindly check & amend my code
Code:
Sub Total()
Dim finalrow As Long
With Sheets("Sales Data")
finalrow = Cells(Rows.Count, "A").End(xlUp).Row
.Range("A" & finalrow + 3).Value = "Total Maturities"
.Range("B" & finalrow + 3) = "=sum(B2:B" & finalrow & ")"
.Range("A" & finalrow + 3).Resize(, 2).Font.bold = True
.Range("A" & finalrow + 3).Resize(, 2).Borders.LineStyle = xlContinuous
.Weight = xlThick
End With
End Sub