View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
margoob margoob is offline
external usenet poster
 
Posts: 1
Default Excel VBA Algorithm

Hi,

I'm not exactly clear about what you want. But sounds like you want
something like Soduko but just for the columns.

In Excel, do you want the whole swapping thing happening in 1 column?

A simple algorithm would be as follow:

Sample Numbers: 1 2 3 4 5...30

User Input: Enters 5 where it was 3
Response: Accepts the new value of the position as 5
Search for the number 5
If Match found, replace that with 3

Rest of the algorithm would depend on how restrictive is the input and
number distribution system.

Please provide more details regarding what you want.


On Dec 23, 10:49*am, Rad wrote:
Hi,

I am looking for an advice on this challenging algorithm.

I have a column in ms excel sheet and has the numbers from 1 – 30, and I
need to use vba code to allow the user to be able to change a number at a
time. *Then as soon as it is changed, the column numbers need the change so
there is no duplicate numbers in the column. *In other words, the column
numbers 1- 30 must have only a number of each.

Any advice will be appreciated.

Thank you,
Rad

I thought about swapping, but the number next to the changed number must be


reduced by a number until the number that has been changed from is reached.

For example:
Original * * * *Changed Changed Again
1 * * * 1 * * * 1
2 * * * 2 * * * 2
3 * * * 3 * * * 10
4 * * * 4 * * * 3
5 * * * 9 * * * 9
6 * * * 5 * * * 4
7 * * * 6 * * * 5
8 * * * 7 * * * 6
9 * * * 8 * * * 7
10 * * *10 * * *8