VBA Code - Add Shuffle Capability on it

lanc3lot

New Member
Joined
Aug 9, 2017
Messages
1
Hello everyone,

I have this code
Code:
[COLOR=#000000][FONT=&quot]Sub CopyData()[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]Dim Rng As Range[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]Dim InputRng As Range, OutRng As Range[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]xTitleId = "Lottery"[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]Set InputRng = Application.Selection[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]Set OutRng = OutRng.Range("A1")[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]For Each Rng In InputRng.Rows[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]    xValue = Rng.Range("A1").Value[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]    xNum = Rng.Range("B1").Value[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]    OutRng.Resize(xNum, 1).Value = xValue[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]    Set OutRng = OutRng.Offset(xNum, 0)[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]Next[/FONT][/COLOR]
[COLOR=#000000][FONT=&quot]End Sub[/FONT][/COLOR]

Is there a way, i can add on the code, shuffle capabilities? So when i run it, the end result will be shuffled it's values? Ty in advance
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,215,206
Messages
6,123,639
Members
449,111
Latest member
ghennedy

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