+ Reply to Thread
Results 1 to 5 of 5

"Invalid use of ME keyword" when trying to loop through all userform controls

  1. #1
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    "Invalid use of ME keyword" when trying to loop through all userform controls

    I have a userform with textboxes as well as other objects. I'm working off a textbook and it uses similar code in the chapter. When I'm trying it I'm getting the error message "Invalid use of ME keyword"

    Please Login or Register  to view this content.
    I also looked up online and tried copying and pasting their code and got the same error message

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: "Invalid use of ME keyword" when trying to loop through all userform controls

    This is in the code module for the userform, and not in a standard module, right?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    Re: "Invalid use of ME keyword" when trying to loop through all userform controls

    Your right, I put it in the from module.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: "Invalid use of ME keyword" when trying to loop through all userform controls

    Can you attach a sample workbook with the offending code?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: "Invalid use of ME keyword" when trying to loop through all userform controls

    This works fine for me.

    Note: MSForms.Control

    Please Login or Register  to view this content.
    I can't understand why you are using this code in the Initialize event, the default value of the textBoxes wil be empty when the form loads
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1