There's a term subroutine or subprogram which stands for a parameterized piece of code that can be called from different places.
Functions and procedures are implementations of those. Usually functions return values and procedures don't return anything.