+ Reply to Thread
Results 1 to 3 of 3

Dynamic Box Creation

  1. #1
    Registered User
    Join Date
    03-20-2013
    Location
    Hangzhou, China
    MS-Off Ver
    Excel 2010
    Posts
    14

    Dynamic Box Creation

    I don't even know exactly what to title this question. I have a box which will return values in cells. There is one cell in which the user will select the number of groups. Within each group the user will select the number of positions within that group. I am completely lost. Basically, each time either of these cells changes, a macro will be run that will update the number of groups and/or open positions in the group which is changed. So by default it may start as 1 group with 1 position. But when the user changes it to 2 groups, another group box will appear, and when the user changes the number of positions within any group box, the number of positions will change. It is quite difficult because there may be up to 17 groups and up to 6 positions for any group. What's more, each new position should have a formula in column a and column b that reference cell A4 and B4. This isn't too bad, because I have had it just copy and paste the group box when duplicating to make more groups. But I am having trouble, because I am running the macro on cell change with "TargetCell" command, and each new group will contain a new target cell. Is this to much to ask. I am having a hard time explaining this, so I am attaching a dumbed down version which should help. I have tried several things with iterations, but the attached worksheet has no macros, because I think it may be easier to start from scratch. To whomever can help, I will thank you immensely and have a deep desire in my heart to buy you a beer next time I am in your town.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Dynamic Box Creation

    See attached file, I hope it's what you need.

    This is the macro I added:
    Please Login or Register  to view this content.
    Regards,
    Antonio
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-20-2013
    Location
    Hangzhou, China
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Dynamic Box Creation

    Antoka05, Thanks for the reply. I am sorry, I think I did not explain quite right. The bordered box is a "group". So the number in C2 would determine the number of "groups" or boxes. Then each box would have a cell similar to B4 in which you would choose how many rows the individual group would have. So for example, if you had 2 groups (the number 2 in cell c4) and one group had 4 positions and the other had 5 positions, then the number 4 would be in B4, and then because there are 4 rows below row 4 for group 1, group 2 would start at maybe row 10. So then B12 would have the number 5. But, there can be up to 17 groups and up to 6 positions in each group. So truly quite dynamic. If this is un-doable then I could rearrange some things. For example, I could make 17 groups always show up, or each group always have 6 rows or something. I just need someone with more vba knowledge to tell me if it's possible.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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