I have 1000 columns which I would like to individually shuffle one by one, is anyone aware of a VBA script that would allow me to do so without repeatedly using =Rand() and then manually sorting by it.
Regards
I have 1000 columns which I would like to individually shuffle one by one, is anyone aware of a VBA script that would allow me to do so without repeatedly using =Rand() and then manually sorting by it.
Regards
Last edited by Savan87; 06-10-2011 at 10:49 AM.
Maybe:
![]()
Sub test() Rows(1).Insert Range("A1").Resize(1, Cells(2, Columns.Count).End(xlToLeft).Column).Formula = "=RAND()" Range("A1").CurrentRegion.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, Orientation:=xlLeftToRight Rows(1).Delete End Sub
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
I dont believe that resolves what I'm trying to achieve,
I want each column to be shuffled randomly so that the order of the values changes but the overall properties of that column stay the same average, range, min, max etc.
I believe that code you posted, changes the columns properties
Thanks very much for your quick reply
I'm not sure I follow, could you post an example workbook with the formula that you think are effected?
Dom
Basically what I want to do is randomly shuffle the values in column A so they are in a new order, I then want to shuffle B so that the values are in a new order and so on
Thanks alot
I want each column to be independent from the one next to it
Thanks
Do you want to shuffle by rows or have each column independent of the one next to it?
ChemistB
My 2?
substitute commas with semi-colons if your region settings requires
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Ty for your assistance once again
Regards
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks