Hello all, I have been tinkering about with a userform for the past week but I've come up against a slight problem.
The Userform that I have created contains both dynamically created controls and a template.
The template controls are all working fine and I have managed to get the userform to add dynamic controls with a button press (On the button press the userform adds 3 controls to the third page of the userform, 1 ComboBox, 2 TextBoxes and 3 Labels). On the next button press another set of controls are created just like the first set, but located below the previous set.
For each "Add" button press this is continued, one set of controls at a time, down the page.
My problem is this:
I have been trying to work on coding a delete button that will remove/delete each set of controls each time the delete button is pressed.
I'm sure some of you will ask why I don't just hide the controls instead but I would rather make this as tidy a job as possible and try to learn exactly why the code isn't working as it should be.
I have had some reasonable success however I think the problem lies in my looping or recording/updating my integers properly.
I have noticed when I press the "Add" button a number of times then press "delete" the button removes half the number of lines that I have added (that is to say if I press the "Add" button 4 times and then press "delete" the code removes 2 sets of lines instead of just one, if I press the "Add" button 10 times then press "delete" 5 lines are removed at once etc.)
I have been unable to work out where I'm falling down on this, so any help on this or a push in the right direction would be appreciated.
The code I have been tinkering with is below, apologies in advance for the lack of anotation or labels, I know it's bad form.
Thanks very much for looking through my code, hopefully a new set of eyes on here will point me in the right direction
K
Bookmarks