Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|