My Bubblesort does not looping?

  • So I have this assignment where I must sort numbers in order. I already made the code and it works, but it doesn't loop at all so I have to manually rerun the program. Here's what I have

    And the data is in the attachment below.

    My question is, how do I make the program loop by itself? I really appreciate any help! Thanks in advance.

  • As in your attached example, since your data is in column B and starts from row 3 and ends at row 17, I would change your macro to this:

  • Hi,

    shouldn't a bubble sort reference and compare cell(j,2) and cell(i,2) values.

    this will be quicker

  • pike, not sure that it always will be faster, with the proposed example both score 50 iterations but if the list is already sorted your modifications will do 24 vs. 0 iterations to complete.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!