+ Reply to Thread
Results 1 to 5 of 5

read out of dynamic amount of checkboxes

  1. #1
    Registered User
    Join Date
    11-16-2014
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    5

    read out of dynamic amount of checkboxes

    Hey people!

    I have a bit of a weird problem here and since I am a VBA newbie I thought I'd post my question here.

    I have a userform that is populated with horizontal rows of checkboxes. The amount of checkboxes is based on a number the user puts in. The amounts of rows is based on what catagories the user puts in. A user can put in up to 10 catagories, which forms 10 lines of checkboxes on the userform. Now... when the user clicks "next" the read out of the checkboxes has to be saved to a table on a sheet, corresponding with the checkboxes lay out, in 1's and 0's.

    What I have so far is almost everything, except for the fact that the read out of the checkboxes is all in thesame row on the sheet where the read out is saved, while I want it to correspond with the amount of rows of checkboxes on the form. (Gets complicated to explain...)

    In simpler terms... If my user form looks like this

    Naamloos.jpg

    I want the read out to have thesame amount of rows and columns. Also... If a user decides not to put in category 5, which creates a blank line, it should skip a line in the read out table.

    This is my code so far.

    Please Login or Register  to view this content.
    The difficulty is that the amount of categories as well as the amount of checkboxes is dynamically.

    Hopefully someone can guide me a bit into the right direction.
    Attached Images Attached Images
    Last edited by nasdrasil; 11-21-2014 at 02:04 PM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: read out of dynamic amount of checkboxes

    Hi,

    try this (dynamic label creation inserted, shorter code)
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    11-16-2014
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    5

    Re: read out of dynamic amount of checkboxes

    Hi Tehnexus,

    Thank you a lot for the time you put in. Realizing how hard it is to write code without the file attached... I tried you're code but alas... no avail. You're coding does not provide me with any text boxes. In my piece of code the amount of textboxes is determined by the range in cell D1 and then counts the amount of filled cells going to E1, F1 etc.. I am no VBA guru so I don't know exactely where your code has that part.

    The second part (Sub volgende_click) Gives me a memory error on the line ReDim aData(1 To 10, 1 To j - 3)

    Any thoughts on that?

    Thanks again for your time you put in. Really appreciate it!

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: read out of dynamic amount of checkboxes

    Hi,

    I must have misunderstood you, please have a look on the attached sheet, if the number of labels/categories is different in Blad3 just change it and reupload, thanks.

    nasdrasil.xlsm

  5. #5
    Registered User
    Join Date
    11-16-2014
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    5

    Re: read out of dynamic amount of checkboxes

    Hello tehneXus,

    Your file works just fine :-) The amount of checkboxes in my sheet is based on user input and the value is put in a cell, also the amount of labels (and their names) is based on user input, to a maximum of 10 for now (might expand on that in the future).

    Thanks so much, I think I am able to continue from here! Super!

+ 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. Writing VBA code to read checkboxes
    By swb1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-28-2014, 12:51 AM
  2. Creating Dynamic Checkboxes
    By moosenator in forum Excel General
    Replies: 1
    Last Post: 10-02-2012, 09:32 PM
  3. How do i limit the amount of checkboxes that can be ticked?
    By 10121730 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2012, 12:58 PM
  4. [SOLVED] How to read the Amount and MinusValues of ErrorBars in a series
    By Kevin Beckham in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2006, 09:20 AM
  5. [SOLVED] i want excel to read the amount (no. format-20,000.00) and print .
    By Rajiv Madan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2005, 05:06 AM

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