0

I've got some code that works perfectly fine, but I wanted to add something to it. So I made one of my functions return a value. But, no matter what I return, I get the "Compile error Expected: end of statment" msgbox appearing.

I eventually did this to my code, and I still get the error. Can someone please explain this?

Public Function Addresses() As Integer
 return 1

End Function 
Chris
  • 193
  • 1
  • 4
  • 13

1 Answers1

1

Duplicate of this post, but basically you need to assign the function name the value, for example:

Addresses = 1

instead of

return 1
Community
  • 1
  • 1
Tim S.
  • 2,187
  • 1
  • 25
  • 40
  • I actually found quite a few posts on google trying to find it, but not that one. I promise I tried. lol That's dumb. I don't like VBA. But, Thank you. It worked. – Chris Jul 01 '15 at 21:34