Create sort number of 6 digit...

DavidRoger

Board Regular
Joined
Oct 2, 2011
Messages
135
Hi all,

I have been sorting the number 123456 to get a list of number. The numbers 123456 have sub-number each and are limited from 01 - 58. And there are not repetition among the sub-number.

Example: The first number shall be view as 10203040506, second is 10203040507,...

I have found a way to do it but I am not sure if I have done everything correctly because the process is long.

I want to counter check my list if you have a better solution.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
The way I do it is sort it in all possible sequence like 123456, 123465 since I dont want repetition. Then divide the number 123456 into 1,2,3,4,5,6 (Main number). Then replace 1 with 01 to 58 (sub-number), 2 with 01 to 58, and then 3, 4, 5, 6. Then I would take out any sequence number that has replied number like 01,01,01,01,01,01. After that I concatenate it all up. The first combination number is 01,02,03,04,05,06 into 010203040506. Of course, Excel will only show 10203040506.

I thought if any one who can use the sort method with VBA. It would be much more simpler. I am poor in VBA :biggrin:. If you have other solution, you are welcome.

May be you can just focus on the sub-number instead. You dont have to divide the number like I do.

First number is 10203040506, then 10203040507, on the 53th is 10203040558 and 54th is10203040601. Since there are 33121 column with Excel 2011, I really not sure if the list is correct...
 
Upvote 0
Clear as Molasses.

Could you give an example of what your data looks like, and what you want your results to look like?
 
Upvote 0
Not a problem.

In Excel 2010:

A
1 10203040506
2 10203040507
3 10203040508
4 10203040509
5 10203040510
.
.
.
53 10203040558
54 10203040601
.
.
.
 
Upvote 0
Sorry, I still am totally missing what you're trying to accomplish, how the numbers are intended to change, and what the method is behind it all.
 
Upvote 0
Divide 010203040506 into 01,02,03,04,05,06.

Replace each divided number with 01-58 and no repetition among them.

Let said the 06 when the replaced number come to 58. The number 05 will increase by 1 which my 05 to 06. And the whole proceed of replace the 06 with 01 - 58 begin again.
 
Upvote 0
Again, you aren't being clear (or at least I can't follow you).

Why does 123456 become 010203040506? How does that have to do with 01 to 58? What do you start with, and what do you want to end with? Show some data and give some examples, because your single example just doesn't make any sense to me.
 
Upvote 0
This sounds like we have a bag of 58 numbered balls and are drawing out 6 of them.
Is that the case?
Are you looking to list all of those possibilites?
 
Upvote 0
That would make a whole hell of a lot more sense, now wouldn't it. Wow.

The word "lottery" would have made it a bunch clearer. You are a genius mike.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,248
Members
452,900
Latest member
LisaGo

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