ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What does the me. preface do? (https://www.excelbanter.com/excel-programming/274565-what-does-me-preface-do.html)

David Reid

What does the me. preface do?
 
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

Chip Pearson

What does the me. preface do?
 
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




"David Reid" wrote in message
...
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





All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com