+ Reply to Thread
Results 1 to 2 of 2

forms: looping through multiple textboxes

  1. #1
    Registered User
    Join Date
    02-02-2007
    Posts
    1

    forms: looping through multiple textboxes

    I have several text boxes on a userform, ex mytext1, mytext2...mytext10.

    Part of my code clears out the values in the textboxes, so rather than write separate code for each box, is there a way I can loop through them all

    This code does not work, but shows what I am truing to do
    for i = 1 to 10
    userform1.mytext & i.value = 0
    next i

    Thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Nerp,

    Here is the macro to clear all the textBoxes on the Active UserForm. Add a Standard VBA Module to your project and then copy and paste the code into it.

    Please Login or Register  to view this content.
    You can run the macro maually by typing ALT+f8 and select it from the macros list, or call from code.

    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 02-02-2007 at 09:10 PM. Reason: Misread the post as CheckBoxes instead of TextBoxes

+ 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