The below function GetMaxReturn runs as expected while running it from a regular sub scope:
Sub Macro2() Dim MaxReturn As Double MaxReturn = GetM