Excel 2007 VB function call return value syntax question

P

pop tufty

office 2007, excel, XP, dell laptop

Of course when I upgraded to office 2007, I have to port my macros.
I am getting a syntax error on this function and do not know why.
Help button is not much use.

Function Get_Value()
Dim Value As Integer
Value = 10
Return Value ' <-- syntax error shows here
End Function

How is one supposed to return a value from a function?

This did not work either:
Function Get_Value() As Integer
Get_Value = 10
Exit Function
End Function


Thanks - Pop Tufty
 
J

Jim Rech

This did not work either:

Yes it does.

You don't need this, not that it does any harm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top