+ Reply to Thread
Results 1 to 3 of 3

Userform - Number of text boxes depends on what user enters

  1. #1
    Registered User
    Join Date
    02-02-2015
    Location
    England
    MS-Off Ver
    MS Office 2013
    Posts
    1

    Userform - Number of text boxes depends on what user enters

    Hello.

    I am creating a VBA tool for a company. For them to be able to easily use the tool, I am using a Userform.

    I have asked for the user to enter how many zones they have in a building which is a numeric value. How then can I either get the Userform to generate the number of text boxes that the user has inputted in the question above?

    If not on the userform, how do I get the spreadsheet to then only show the number of rows that the user has defined.

    I also wanted the user to to provide a matrix in order to understand what rooms are adjacent to one another. Is there an easy way for this to be incorporated on the userform?

    Any help you can provide would be much appreciated.


    Vaish

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Userform - Number of text boxes depends on what user enters

    Do you obtain the number of zones before the userform starts? Or is it an existing textbox? You could use the change event of the zones textbox to generate new textboxes once the value of the zones text box changes?

    Edit: I take that back... perhaps the exit even is better, since typing the first digit of a 2-digit number would trigger the change macro.
    Last edited by Arkadi; 02-02-2015 at 01:15 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Userform - Number of text boxes depends on what user enters

    Vaishin, my suggestion would be to get the number of zones during the form initialization as an input box prompt, and then dynamically generate the textboxes from that anwer. Something like this?

    Please Login or Register  to view this content.

+ 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. [SOLVED] Add number of text boxes inside a UserForm
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-13-2013, 06:46 AM
  2. [SOLVED] Make user enter data into one of two text boxes in a userform
    By bberger1985 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2013, 11:39 AM
  3. [SOLVED] How to pop up message when user enters any text in TextBox. Should be enter by number only
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-21-2013, 02:26 AM
  4. Check for Duplicates when user enters values in the UserForm
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-27-2012, 03:43 PM
  5. userform, label text display value depends on user input
    By kp7qc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2011, 05:09 PM

Tags for this Thread

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