You can set the sheet name in the script as a global variable.
Thank you so much Heru and @Greg_L. This is exactly what I needed. I just tested it on several different sheets and it works perfectly. Now, I just have to be brave enough to put it on my production sheet with real data.
@LeventK I am be very interested in using your proposed script to delete the empty rows. Unfortunately, I have no idea how to modify it to delete the rows as you suggest.
When running the script as it is, I get a ‘server error’ with no other information as to what is wrong.