View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] derick.gasimperial@gmail.com is offline
external usenet poster
 
Posts: 4
Default Rearrange numbers in a range

I have the numbers 1,2,3,4,5,6 in the source range("b4:g4") and would like to produce

1,2,3,4,5,6
2,3,4,5,6,1
3,4,5,6,1,2
4,5,6,1,2,3
5,6,1,2,3,4
6,1,2,3,4,5

Basically the code would take each number in the source range and place it in the 6th column if it is between 1 and 10 inclusive.
First it would have to the count how many numbers in the source range "b4:g4" are equal to and less than 10.
In this case the 6 numbers are less than 10 so it would produce 6 results. if it was 5 numbers that are less than 10 then it would produce 5 results. If all the numbers are more than 10 then no action is required.

The numbers in the source range can be in any order not necessarily in sequence.

Any help would be greatly appreciated.
Thank you