this is the basic layout of a function:
Friend Function myFunct(ByVal Something As Something) As Something
Return Something
End Function
you first give the function a scope (in this case it's Friend but it could be Private, Protected, Public)
next you give it a name (myFunct is an example) then you declare the parameters it'll accept and how they'll be passed (ByVal/ByRef are how the data is passed, ByVal passes a copy whereas ByRef passes a pointer to the actual value(s)) and functions can accept Integers, Doubles, Singles, Chars, Decimals, Strings, etc... too
then lastly you declare what data type the function will be returning (String, Integer, Double, etc...)
then somewhere in the function you use the 'Return' keyword to actually return the value from the function
that's about as simple as i can get