Hi all
Making slow, but steady progress with my "learn yourself VBA programming" i never the less has run into a problem i would really appriciate some help soving...
The case is as follows... making a userform, i have a textbox that the user puts a number into (something like 1 to 1000, but always an integer). Then the user checks of any number (and combination) of 3 checkbox's i have in the userform. Below the checkboxes are 3 textboxes, one for each checkbox... what i need is a code that will take the integer number from the first textbox and divede that number amongst the appropriate textboxes, with 1 at a time... and ofc only assign numbers to the textboxes with checkboxes ticket of (true)??
Just to clearify, ill try and make up 2 scenarios..
1. user enters 38 in the first textbox... and theb ticks off all 3 checkboxes... then the code should divide the number of 38 to the 3 textboxes, so that textbox2 ends up with the value of 13, textbox3 = 13 and last textbox4 = 12.... (13 + 13 + 12 = 38)
2. user stil enters 38, but this time only ticks of checkbox 1 and checkbox 3... then both textbox2 and textbox4 should end up with the value of 19...
Anyone got an idea how to solve this??
my own thoughts are that it must be something in the line of getting the code to reckognise wich checkboxes are true and then lopping through the corresponding textboxes as many times as the number entered in textbox 1, each time adding +1 to the textbox value... but bugger, i cant "code" that (yet...)... any help will be greatly appriciatet...
best regards
PS. the eventhandler part i think i can handle... so only the code for the assigning of numbers are needed![]()
Bookmarks