I know a the difference between a function and a sub, but when do I use function instead of a sub is confusing...

Best Regards!
Eric