+ Reply to Thread
Results 1 to 2 of 2

Thread: Building a dynamic task list based on checkbox selections

  1. #1
    Registered User
    Join Date
    03-15-2011
    Location
    NH, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Building a dynamic task list based on checkbox selections

    Hello, all. You'll have to excuse me as I'm new to the forum but see there's a world of helpful people and information here so I'd like to take this opportunity to ask for your help.

    First - I don't program but I'm very interested in getting into VBA with all the work I have that it can help me with. But here's my issue:

    I have a workbook with project plan task list items
    Tasks are dependent on the product being installed (products are listed in the task list)
    I've created a userform with checkboxes for the products to choose from. You can have one or many products installed.

    1. How do I assign the variable to the product name(s) that have been checked so I can use those variables when pulling the specific data over?
    2. Once I do that, what is the best way to pull the task list items from the complete task list for only those products selected from the userform?

    Right now I have the task list, the userform, and some buttons that simply pull the userform up in once case and another that checks for a worksheet called "Project Plan" and creates it if it's not there or flags a message box if it already exists. It's neat little stuff but it's far from what I need right now.

    Any assistance would be highly appreciated. Thank you very much in advance and I'll try not to ask too many follow-up questions!!!

    Regards,

    SStar

  2. #2
    Registered User
    Join Date
    03-15-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Building a dynamic task list based on checkbox selections

    G'Day sstar,

    If you could send me an example spreadsheet i can have a quick look if you like.

    BUT basically to assign variables in VBA to a check box value it looks a bit like:

    Dim MyProduct As ? (either variant, string, boolean, integer, long, etc)
    
    If myFormName.CheckBoxName.Value = True Then
     MyProduct = "whatever product"
    End If
    As you can see this would be a real hassle if you have ALOT of check boxes / products as you would require an IF statement for each product / check box. Have you considered using a combobox instead for your products? The code would then be much shorter like:

    Dim MyProduct As String (or whatever data type your after)

    MyProduct = myFormName.mycomboboxname.Value

    Let me know if this helps,

    Chris K.
    Last edited by davesexcel; 03-15-2011 at 07:26 PM. Reason: code tags required please read the forum rules

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0