![]() |
Anybody know VBA?
I'm working on a VBA project, and I think I remember that a few people here had some expertise in this language. If there's anybody here that could help me with my problem (sorting a 2D array), would you mind if I posted some code?
Thanks, Adrian |
Well, I could always try....
|
If you could help out, that's great.
I got a modification of my code (a bubble sort that sorts a one-dimensional array) which now sorts a two dimensional array. The problem is, it doesn't work. I barely understand bubble sorts as it is, and I can't figure out why the second one won't sort. Here's the code: Code:
Adrian |
Mind that bubble sort only sort a one dimensional array
1 - 5 - 4 - 7 2 - 5 - 9 - 1 8 - 4 - 2 - 3 How should this 2D array be sorted according to you? |
Thanks. The professor was pretty specific that the bubble sort could be adapted...I don't know though.
The 2D array (it may contain numbers or strings) should be run through the sort, and come out with the first element sorted in ascending order, the second element organized on the first element. So: 1-2 3-4 2-3 4-5 would come out: 1-2 2-3 3-4 4-5 Thanks much! I really appreciate it. Adrian |
I remember doing bubble sorts in maths, one of the many things I've forgotten since, due to it having no use to me, in the 3 years since I finished college.
|
I don't know enough of VBA concepts to implement a bubble sort.
The way I see it, you just implement a regular bubble sort. The only modification is that you surround it with a for-loop which bubblesort each column. That's why I don't get this statement: Code:
For j = First To (Last - i - 1) |
| All times are GMT +2. The time now is 02:17 PM. |
Powered by vBulletin® Version 3.8.11.
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.