Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Excel 2007 VB function call return value syntax question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pop tufty - 18 Jan 2008 18:06 GMT
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
Jim Rech - 19 Jan 2008 16:50 GMT
>>This did not work either:

Yes it does.

>>Exit Function

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

Jim

> office 2007, excel, XP, dell laptop
>
[quoted text clipped - 17 lines]
>
> Thanks - Pop Tufty
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.