#1   Report Post  
nc
 
Posts: n/a
Default Me?

Hi

At http://www.contextures.com/xlUserForm01.html
they use

ws.Cells(iRow, 1).Value = Me.txtPart.Value

what is the Me for?

Thanks.
  #2   Report Post  
Paul B
 
Posts: n/a
Default

nc, here is an answer from a post by Chip Pearson on the subject

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




--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"nc" wrote in message
...
Hi

At http://www.contextures.com/xlUserForm01.html
they use

ws.Cells(iRow, 1).Value = Me.txtPart.Value

what is the Me for?

Thanks.



  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Me refers to the containing object, probably a userform in this case.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"nc" wrote in message
...
Hi

At http://www.contextures.com/xlUserForm01.html
they use

ws.Cells(iRow, 1).Value = Me.txtPart.Value

what is the Me for?

Thanks.



  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

Me refers to the thing/object that holds the code.

In this case, it refers to that Userform.

You may see it in a worksheet module, too. In that case, it refers to the
worksheet that owns the code.

Same thing in ThisWorkbook--it refers to the workbook owning the code.

nc wrote:

Hi

At http://www.contextures.com/xlUserForm01.html
they use

ws.Cells(iRow, 1).Value = Me.txtPart.Value

what is the Me for?

Thanks.


--

Dave Peterson
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



All times are GMT +1. The time now is 06:46 AM.

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"