Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort a range randomly

I have a range of data
A11:DU298

I want to sort the whole range randomly Column F is null. The formul
=Rand() can be put in each cell in F. But when I did that and then ra
some different code. The function in F just kept changing randomly.

I only want to sort the range by random once and then run my unrelate
code.

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort a range randomly

after copying the rand formula down convert to numbers :-
select/edit/paste special/ values

Then sort on that colum

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort a range randomly

I need the sort to happen everytime I run the code, not just one time
Because it will continue to sort in the same order if I paste values t
that column. If I'm understanding you correctly

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Sort a range randomly

copy it first
then edit / paste special - values

cheers
JulieD

"BrianB " wrote in message
...
after copying the rand formula down convert to numbers :-
select/edit/paste special/ values

Then sort on that column


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort a range randomly

The rand() function will change each time the sheet is recalculated (which
occurs after the sort). If you don't need the numbers in column F, then
just disregard them (or clear them after the sort). If you want feedback
that the sort was actually in some order, then you can past special values
before the sort as the others have suggested.

--
Regards,
Tom Ogilvy

"hotherps " wrote in message
...
I have a range of data
A11:DU298

I want to sort the whole range randomly Column F is null. The formula
=Rand() can be put in each cell in F. But when I did that and then ran
some different code. The function in F just kept changing randomly.

I only want to sort the range by random once and then run my unrelated
code.

Thanks


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort a range randomly

OK I understand what all of you mean now. I wasn't getting it at first.

But let me ask you this

Is there a way I could simulate that the F9 (autocalc) function before
the sort runs?

Then I would not have to clear it or add it

Thanks to all


---
Message posted from http://www.ExcelForum.com/

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort a range randomly

If the code adds the formula each time, it should make no difference. If
you added the formula manually, then after each sort, it is already ready to
do the next one. It sounds like it is doing exactly what you need? What is
the real problem? Perhaps you haven't explained it correctly.

--
Regards,
Tom Ogilvy

"hotherps " wrote in message
...
I need the sort to happen everytime I run the code, not just one time.
Because it will continue to sort in the same order if I paste values to
that column. If I'm understanding you correctly.


---
Message posted from http://www.ExcelForum.com/



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort a range randomly

I know it was alittle confusing, but I think it is OK now.

The real problem was, once my unrelated code starting running after the
random sort. All of the cells in that (F) column were randomly changing
as the code was running and it was really slowing it down.

Thanks again


---
Message posted from http://www.ExcelForum.com/

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort a range randomly

You set calculation to manual in your code

Application.Calculation = xlManual

and perhaps later set it back to automatic

Application.Calculation = xlAutomatic

if at some point you want to force a calculation


Application.Calculate

--
Regards,
Tom Ogilvy


"hotherps " wrote in message
...
I know it was alittle confusing, but I think it is OK now.

The real problem was, once my unrelated code starting running after the
random sort. All of the cells in that (F) column were randomly changing
as the code was running and it was really slowing it down.

Thanks again


---
Message posted from http://www.ExcelForum.com/



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort a range randomly

Thank you for the information. On both of my post

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i sort rows randomly? Jeremy Excel Discussion (Misc queries) 5 December 12th 07 01:03 PM
How do I randomly sort data in a column? goody Excel Discussion (Misc queries) 1 October 2nd 06 03:36 PM
How do I sort randomly a list of 22 numbers Deal or No Deal game simulation Excel Discussion (Misc queries) 3 May 21st 06 10:27 AM
How do I randomly sort a list of names? JIreland Excel Discussion (Misc queries) 3 May 17th 06 07:39 AM
How do you randomly sort a RANGE latturne Excel Worksheet Functions 4 September 29th 05 09:40 PM


All times are GMT +1. The time now is 11:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"