+ Reply to Thread
Results 1 to 4 of 4

Variable Controls

  1. #1
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Variable Controls

    Hi

    What's the syntax for referring to a variable control name?

    I have a userform with 20 textboxes (txtAmount1, txtAmount2 etc) and I want to loop through each of those controls, so I want to do something like:

    Please Login or Register  to view this content.

    I know I can loop through all controls on the form (and restrict based on control name) but I want to be able to do something similar to the above for other reasons: I have another column of textboxes (txtSupplier1, txtSupplier2 etc) and if I update txtSupplier2 then I want to update the corresponding txtAmount2.

    Any help is appreciated.

    Dion
    Last edited by mojo249; 09-10-2011 at 11:33 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Variable Controls

    Something like..

    Please Login or Register  to view this content.
    Martin

  3. #3
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Variable Controls

    Try
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Variable Controls

    Perfect. Both worked.

    Thanks very much.

+ 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