Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default What Is "Me." in Visual Basic Coding?

In reading some examples written in J. Walkenbach's Visual
Basic Programming book, I noticed he now and then uses the
symbol "Me.". Examples: Me.Activate Me.Saved = True
These were used in discussions of event programs, if that's
any help. I checked, and they aren't defined variables or
arguments.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default What Is "Me." in Visual Basic Coding?

The 'Me' keyword always refers to the instance of the class in
which it is contains. For example, if it appears in the
ThisWorkbook module, it refers to ThisWorkbook. If it appears in
Class1, it refers to the instance of Class1 when the line of code
is executed.

'Me' is only valid in class modules (including userforms,
classes, ThisWorkbook and the Sheet code modules). It is not
valid in a standard module.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"SidBord" wrote in message
...
In reading some examples written in J. Walkenbach's Visual
Basic Programming book, I noticed he now and then uses the
symbol "Me.". Examples: Me.Activate Me.Saved = True
These were used in discussions of event programs, if that's
any help. I checked, and they aren't defined variables or
arguments.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default What Is "Me." in Visual Basic Coding?

me is used in object modules to refer to the current instance of the
object (or class)

examples of object modules:
userforms = me rfers to the running form
modules for worksheets = me refers to the sheet
thisworkbook = me refers to the workbook in which the code resides

you cannot use it in 'normal modules'





keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"SidBord" wrote:

In reading some examples written in J. Walkenbach's Visual
Basic Programming book, I noticed he now and then uses the
symbol "Me.". Examples: Me.Activate Me.Saved = True
These were used in discussions of event programs, if that's
any help. I checked, and they aren't defined variables or
arguments.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default What Is "Me." in Visual Basic Coding?

Me stands for the current control, this way you don't have to retype the
current control's name over and over.

for example if a button control needs to change its own label then you can
just do this:

Me.Label = 'New Name'

"SidBord" wrote in message
...
In reading some examples written in J. Walkenbach's Visual
Basic Programming book, I noticed he now and then uses the
symbol "Me.". Examples: Me.Activate Me.Saved = True
These were used in discussions of event programs, if that's
any help. I checked, and they aren't defined variables or
arguments.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default What Is "Me." in Visual Basic Coding?

Thanx, guys. That clears that up.
-----Original Message-----
me is used in object modules to refer to the current

instance of the
object (or class)

examples of object modules:
userforms = me rfers to the running form
modules for worksheets = me refers to the sheet
thisworkbook = me refers to the workbook in which the

code resides

you cannot use it in 'normal modules'





keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"SidBord" wrote:

In reading some examples written in J. Walkenbach's Visual
Basic Programming book, I noticed he now and then uses the
symbol "Me.". Examples: Me.Activate Me.Saved = True
These were used in discussions of event programs, if that's
any help. I checked, and they aren't defined variables or
arguments.


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic "Blinking" Cursor??? Ken Excel Discussion (Misc queries) 5 November 12th 08 04:00 PM
Excel crashes on "Close" Visual Basic error 400 [email protected] Excel Discussion (Misc queries) 3 March 19th 08 03:45 PM
"Microsoft Visual Basic runtime error '424' object required". SharonG. Excel Worksheet Functions 0 July 5th 06 01:36 AM
Registry key for "Trust access to Visual Basic project" tmarko[_13_] Excel Programming 3 June 14th 04 10:40 AM
How to set equivalent of Visual Basic "redraw = false" GrantS Excel Programming 4 January 15th 04 06:13 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"