Randomly Changing cost code

gurubh

New Member
Joined
Dec 19, 2018
Messages
1
I have cost range as shown below C1 till C15. However, I want to a button which can change the Cost code randomly however amount range should be in same place.

For example, if C1 assigned to 0 to 3Lacs as below, it should change as C12(or any random) as 0 to 3 Lacs when I click that button. However random should be with the range from C1 to C15 and all the range should change accordingly and no repetitive of the cost code.

I mean, once I click on random button, upto 3 lacs becomes something from C2 to C15 and other range gets different. and it should keep changing the codes every time the button clicked.
[TABLE="width: 252"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD]C1[/TD]
[TD] - [/TD]
[TD] 299,999[/TD]
[/TR]
[TR]
[TD]C2[/TD]
[TD] 300,000[/TD]
[TD] 499,999[/TD]
[/TR]
[TR]
[TD]C3[/TD]
[TD] 500,000[/TD]
[TD] 799,999[/TD]
[/TR]
[TR]
[TD]C4[/TD]
[TD] 800,000[/TD]
[TD] 999,999[/TD]
[/TR]
[TR]
[TD]C5[/TD]
[TD] 1,000,000[/TD]
[TD] 1,199,999[/TD]
[/TR]
[TR]
[TD]C6[/TD]
[TD] 1,200,000[/TD]
[TD] 1,499,999[/TD]
[/TR]
[TR]
[TD]C7[/TD]
[TD] 1,500,000[/TD]
[TD] 1,799,999[/TD]
[/TR]
[TR]
[TD]C8[/TD]
[TD] 1,800,000[/TD]
[TD] 1,999,999[/TD]
[/TR]
[TR]
[TD]C9[/TD]
[TD] 2,000,000[/TD]
[TD] 2,299,999[/TD]
[/TR]
[TR]
[TD]C10[/TD]
[TD] 2,300,000[/TD]
[TD] 2,599,999[/TD]
[/TR]
[TR]
[TD]C11[/TD]
[TD] 2,600,000[/TD]
[TD] 2,899,999[/TD]
[/TR]
[TR]
[TD]C12[/TD]
[TD] 2,900,000[/TD]
[TD] 3,199,999[/TD]
[/TR]
[TR]
[TD]C13[/TD]
[TD] 3,200,000[/TD]
[TD] 3,499,999[/TD]
[/TR]
[TR]
[TD]C14[/TD]
[TD] 3,500,000[/TD]
[TD] 3,799,999[/TD]
[/TR]
[TR]
[TD]C15[/TD]
[TD] 3,800,000[/TD]
[TD] 3,999,999[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You could record these step to a macro.

In column D (or any empty column) put this formula for each row
=RANDBETWEEN(1,1000)
This will put a random number in that column.

Select columns C and D and Sort them based on column D.
You could clear column D after if you like.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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