Stats
69,489
reputation
93k
reached
16
answers
9
questions
Loading…
About
About Me
Me
is a reserved name (you can't have a variable by that name) that refers to something that can only exist at run-time in a procedure's scope: the current object. Under the hood, when you make a member call to DoSomething
against a Class1
object, the call goes essentially like this:
Set obj = New Class1
Class1.DoSomething obj
This means DoSomething
looks like this in VBA:
Public Sub DoSomething()
End Sub
But VBA sees it like this:
Public Sub DoSomething(ByVal Me As Class1)
End Sub
That makes Me
an implicit locally-scoped ByVal
parameter of type Class1
, and inside the DoSomething
scope it holds a reference to whatever object the caller is currently using.
Moderator (retired) on Code Review Stack Exchange, 2015-2021
Microsoft MVP (Office Apps & Services), 2018-2022
Badges
View all badges
This user doesn’t have any gold badges yet.
22
silver badges
-
PunditMay 17, 2017
-
Civic DutyMay 18, 2017
-
NecromancerApr 28, 2014
34
bronze badges
-
DisciplinedFeb 21, 2015
-
CuriousJul 24, 2016
-
OrganizerMar 4, 2015
Top tags
View all tags
295
Score
17
Posts
68
Posts %
148
Score
6
Posts
24
Posts %
148
Score
6
Posts
24
Posts %
71
Score
4
Posts
16
Posts %
62
Score
4
Posts
16
Posts %
24
Score
2
Posts
8
Posts %