Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
For those who don't know, return values from functions are stupidly returned by assigning to the function name:
Function Square(X as Integer)
Square = X * X
End Function
If you misspell the function name, that just creates a new variable with that name. -
@configurator oh my god thank you! I'm new to VBA. Do you have any other tips or tricks up your sleeve? I'm using the rubber duck extension. Any others you would recommend by chance?
-
@polaroidkidd unfortunately nope. I never actually worked in VBA except writing a few tiny Excel macros, though I do have some VB experience in my distant past. VBA is different than VB, but mostly similar enough.
If you do get stuck on something specific with VBA, I'm usually happy to help - email me or find me on Hangouts if you need some help.
Related Rants
I spent two hours trying to figure out why VBA was giving me the correct values when I used debug.print, but not when I got the returned from the function.
I MISSPENT THE GOOD DAMN FUNCTION IN THE RETURN AND VBA DOESN'T SHOW OR AS A BUG OR GOOD DAMN ANYTHING....
I hate this thing so much.
On the bright side the office thinks I'm some sort of magical tech-deity.
undefined
in
tags
many
fit
how
i
master of ms
excel
hate it
can
vba