+ Reply to Thread
Results 1 to 8 of 8

User Form Indexing Data

  1. #1
    Registered User
    Join Date
    01-25-2022
    Location
    WISCONSIN
    MS-Off Ver
    2013
    Posts
    4

    User Form Indexing Data

    Hello, I am new to vba and I am trying to make a user form and then have data index to different work sheets. Each form may have a different number of data entries, for example, one particular batch may use 10 units, and another batch may only use 2. Id like excel to be able to count how many data entries are on the particular form and only index that amount of data.

    Specifically, each form has 1 lot # but multiple, lets say "barrels', that make up the batch. Batch 1 might have 3 and batch 2 might have 10. Id like excel to index barrel #s to column B and then put the respective batch number in the corresponding column A.

    What I have so far is below. It is taking the values of the text boxes on my form and indexing them where needed. The issue i am having is there is 20 text boxes for 'barrels' but if I only need 3, I still get 20 lot #s. I have been trying to do an if statement to only put lot #s where there are containers, but I am struggling.

    Please Login or Register  to view this content.

    Mod note: code tags added. Please do this yourself in future. Thanks.
    Last edited by AliGW; 01-26-2022 at 07:51 AM. Reason: Code tags added.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: User Form Indexing Data

    see big yellow banner - how to upload your workbook - far easier then to give a solution relative to your real world problem.
    hint; please also place your code between code tags as required by forum rules.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    01-25-2022
    Location
    WISCONSIN
    MS-Off Ver
    2013
    Posts
    4

    Re: User Form Indexing Data

    torachan, thank you for your response and sorry for the clerical errors. The example should be attached. The cells are populating from my batchform and you can see on "Batch info" that column "A" over populated.
    Attached Files Attached Files

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: User Form Indexing Data

    Does the attached do what you want - if it does follow the logic for you third sheet.
    please put your original code between code tags - as this is your first post you may be lucky and a kind moderator may help you.
    Last edited by torachan; 01-26-2022 at 05:18 AM.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: User Form Indexing Data

    @Barkes

    This is a help forum. This type of reponse is unacceptable.

    If you have a question, please start a new thread and ask it. If not, then please don't post here, unless your post is helpful in a way that will lead to a solution.

    Thank you
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    01-25-2022
    Location
    WISCONSIN
    MS-Off Ver
    2013
    Posts
    4

    Re: User Form Indexing Data

    Quote Originally Posted by torachan View Post
    Does the attached do what you want - if it does follow the logic for you third sheet.
    please put your original code between code tags - as this is your first post you may be lucky and a kind moderator may help you.
    Yes, this is great. Thanks! I was not aware of using the controls as variables - really appreciate the help!

  7. #7
    Registered User
    Join Date
    01-25-2022
    Location
    WISCONSIN
    MS-Off Ver
    2013
    Posts
    4

    Re: User Form Indexing Data

    Quote Originally Posted by JONK5500 View Post
    Yes, this is great. Thanks! I was not aware of using the controls as variables - really appreciate the help!
    How would I adjust this code so that rather than having x = 20 list vertically in columns with the same batch lot value, to having x=20 and if there is text transposing from column B to column U?

    Please Login or Register  to view this content.

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: User Form Indexing Data

    Something like ??????

    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. Replies: 16
    Last Post: 11-29-2019, 05:25 PM
  2. [SOLVED] User Form with Empty row but user may enter data manually
    By Nole68 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2015, 11:35 AM
  3. User form to post data and charts according to user defined selections
    By siroco79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2013, 11:16 AM
  4. Replies: 1
    Last Post: 08-28-2013, 05:04 PM
  5. [SOLVED] User forms - choosing location of your data to be shown in your user form
    By jasonbwt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2012, 08:48 AM
  6. Transfer User form data to a worksheet w.r.t. combobox item on the form
    By nm766 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2011, 12:43 PM
  7. Look Up Data and Plug into Form - User Form in Reverse?
    By Leah in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2009, 04:08 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