Simple Question

Tridiro

Board Regular
Joined
Apr 26, 2007
Messages
97
In VBA, what does "me" mean ?


example: me.textbox1.hide

I cant find it in the object browser.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
"Me" refers to the form the textbox is found on. Or actually the form (/report in Access) running the sub or function you are in.
 
Last edited:
Upvote 0
It's self-referential, in regard to the containing class and its properties, methods or child objects. Hence, determined by context. Most frequently in Excel VBA you see it in userforms (referring to the userform containing the code) or to worksheets (referring to the worksheet containing the code).

But you *could* also use it in a custom class to refer to a class method or property.

That's my best on the subject - once you get used to it you'll find it handy.

ξ
 
Upvote 0
It's self-referential, in regard to the containing class and its properties, methods or child objects. Hence, determined by context. Most frequently in Excel VBA you see it in userforms (referring to the userform containing the code) or to worksheets (referring to the worksheet containing the code).

But you *could* also use it in a custom class to refer to a class method or property.


ξ

Thanks a lot for your helpful information. Keep up the good work.
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top