Thank you very much, NoSparks! Now it stops when it's out of visible rows
However, the data for Flname is a hyperlink in the Data sheet and should also be a hyperlink when the template is saved as new workbook. Is this possible?
I tried
Code:
Dim Flname As Hyperlink
but that didn't work, unfortunately.
EDIT:
To be more clear, the hyperlink shows as 1234-5678 but links to for example google.com/1234-5678. The cell in the template should still read 1234-5678 but the link should be still the same. This is important as the filename is based on the contents of this cell.