+ Reply to Thread
Results 1 to 2 of 2

Given a User Form with 256 textboxes - how can I access a selected one?

  1. #1
    Registered User
    Join Date
    04-27-2013
    Location
    Bradenton,florida
    MS-Off Ver
    Excel 2007
    Posts
    40

    Given a User Form with 256 textboxes - how can I access a selected one?

    I have an Excel Form based application I am working on and one of the User Forms has 256 Text boxes (named T1, T2 . . . T256). I would like to be able to write a subroutine with 1 calling argument (a value 1 – 256) and have the subroutine set the background color of the selected text box. I know I can do this with 256 if..then statements but there must be a more efficient way to do this. Thank You

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Given a User Form with 256 textboxes - how can I access a selected one?

    You can use the controls object of the form to reference controls by name.
    You can incorporate the following example in to a routine

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sum 2 textboxes on user form to 3rd when data entered
    By edopts in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-17-2014, 04:04 PM
  2. Copy data from previous row into new row IF user form textboxes are not populated
    By syl127 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2014, 10:35 AM
  3. grouping multiple textboxes on a user form
    By Obfuscated in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-27-2013, 05:31 PM
  4. Can a command button make textboxes dissapear from a user form
    By shakey775 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-19-2012, 03:01 AM
  5. Formatting alignment in User Form Textboxes
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2011, 01:06 PM

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