Hello everybody.
I am doing this manually but it is to long; I need to generate a list of 6 numbers base on the differences between the numbers.
As overview of this I bring this little example: 18-4-12-7-1 this is the condition. work like this.
1-19-23-35-42-43 this is the number generate by the difference, if you see between 1-19 =abs is 18 etc. etc. and the number can go until 53 only thats the maximum number. In the worksheet I highlight in yellow (from 1 to 53).
If you have just one difference thats not a problem, the point here is I have a list of GAPS (DIFFERENCES) they are in A1:E1490 . and this gap-list is dynamic, increace weekly two number, thats why I need a vba. I know there are a formula but still is a big typing-work. I need the code go row by row of the gaps, generate the list of numbers corresponding to each gap and tell me the total combination found. Any help welcome. thanks.
[TABLE="width: 240"]
<tbody>[TR]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[/TR]
</tbody>[/TABLE]
I am doing this manually but it is to long; I need to generate a list of 6 numbers base on the differences between the numbers.
As overview of this I bring this little example: 18-4-12-7-1 this is the condition. work like this.
1-19-23-35-42-43 this is the number generate by the difference, if you see between 1-19 =abs is 18 etc. etc. and the number can go until 53 only thats the maximum number. In the worksheet I highlight in yellow (from 1 to 53).
Code:
[TABLE="width: 214"]
<tbody>[TR]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri]A[/FONT]
[/TD]
[TD="class: xl65, width: 15, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]B[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]C[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]D[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 14, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]E[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 64, bgcolor: #B8CCE4"][/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]H[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]I[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]J[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]K[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]L[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl65, width: 21, bgcolor: #B8CCE4"][FONT=Calibri][SIZE=3][COLOR=#000000]M[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri]18[/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]4[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]12[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]7[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]1[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl67, bgcolor: yellow, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]1[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]19[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]23[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]35[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]42[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]43[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]2[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]20[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]24[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]36[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]43[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]44[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]3[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]21[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]25[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]37[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]44[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]45[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]4[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]22[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]26[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]38[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]45[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]46[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]5[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]23[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]27[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]39[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]46[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]47[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]6[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]24[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]28[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]40[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]47[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]48[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]7[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]25[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]29[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]41[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]48[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]49[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]8[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]26[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]30[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]42[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]49[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]50[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]9[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]27[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]31[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]43[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]50[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]51[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]10[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]28[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]32[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]44[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]51[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]52[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]11[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]29[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]33[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]45[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]52[/COLOR][/SIZE][/FONT]
[/TD]
[TD="class: xl67, bgcolor: yellow, align: right"][FONT=Calibri][SIZE=3][COLOR=#000000]53[/COLOR][/SIZE][/FONT]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 240"]
<tbody>[TR]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[TD="width: 64, bgcolor: transparent, align: right"][/TD]
[/TR]
</tbody>[/TABLE]