Hello Rerock,

Change the Dim statement for ret to this...
    Dim ret     As Long