Just like looping through the rows to find the last row, it is not really good practise to open a table and loop to the last record as in the example.
Better to sort the table descending by ID and select the TOP 1 record. Your real DBA will appreciate it if this gets moves to an serious DB
There's a sample DB in the attachment - extract to the same directory as the workbook this is test with. Remembering, if you open a new workbook it must be saved first as 'Application.Path' (used in the code) is empty until the WB has been saved.
Bookmarks