What does the me. preface do?

  • Thread starter Thread starter David Reid
  • Start date Start date
D

David Reid

Just curious as to understand what the me. preface
practically does in VBA code.

I have code that is essentially

me.textbox1.value = me.spinbutton1.value.

the code appears to work the same with out the me
preface, just wanted to understand what the me does.

Thanks
Dave
 
Dave,

The "Me" identifier creates a reference to the class which
contains it. So if you have code in a class module, Me refers to
that instance of the class. If you have code behind a userform, Me
refers to that instance of the userform. Used in the ThisWorkbook
code module, Me is the same as ThisWorkbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Back
Top