VBA unplanned 1 to 7 numbers

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
Using Excel 2010
Hello,

I need VBA which can give me input option.
1st always use 1 to 7 numbers, and the sum of row must be always 7
2nd how many groups to be filled? For example my answer is fill in 5 groups
3rd how may rows to be filled? For example my answer is fill 200 rows
So the VBA generate 200 rows filling 5 groups per row which sum must be 7 for each row

Here is data sheet attached with some groups example (may group are 2, 3, 4, 5, 6) but sum of row is always 7 hope I explain it if any question please ask.

Regards,
Moti
Excel Question.xlsm
ABCDEFGHIJKLMNO
1
2
3
4CountCountCountCountCountCountCountCountCountCountTotal
5Gr1Gr2Gr3Gr4Gr5Gr6Gr7Gr8Gr9GroupsAlways 7
6222147
7221247
8222147
91111357
10231147
1121111167
1222337
132211157
141111357
15211347
161122157
1723237
18411147
192112157
2021111167
212121157
222121157
233111157
242211157
256127
26312147
27212247
28122247
291121257
30321147
316127
32
33
34
Hoja1
Cell Formulas
RangeFormula
L6:L31L6=COUNTIF(C6:K6,">0")
M6:M31M6=SUM(C6:K6)
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
In what way is this different to your question on EF other than you now want 5 groups & numbers 1-7?
 
Upvote 0
Cross posted at: Random fill 4 group which total must be 7 [SOLVED]
Looks like it has already been solved over there too.

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.
Be sure to follow & read the link at the end of the rule too (though I think you should be familiar with our rules on Cross-Posting by now)!

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Hello again, really I find my mistake it should be correct (0 to7 numbers) split within 9 groups with each line sum must be = 7 not (1 to 7 numbers) I need to find random filled “X”group and with “X” row out of using 0 to 7 numbers via input pop up box input. Please does it is possible to get VBA solution.

Regards,
Moti
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top