Hi have used the below code to remove the last row of data from a table. The code works ok in isolation but when run as part of a larger set of code it does not remove the last row. Any ideas on what is causing this and solution would be appreciated.
Sub TrimJrnl()
Dim wsR2 As Worksheet
Set wsR2 = ThisWorkbook.Sheets("Journal")
lastrow = wsR2.ListObjects("xJrnl").Range.rows.Count
rows(lastrow).Delete
End Sub