Thank you for your reply! I'm not getting an error on the code now but it's not sorting in the correct order (image below).

Do you know why this might be?

Attachment 619633