-
Fun Excel - Spiral through a range
One of my professors told me about a job interview question that I thought was interesting:
Given any 2d array, how would you loop through the array in a "spiral" format?
I thought I would give it a try and I used Excel VBA because I can represent looping through the range of a worksheet visually by coloring which cell I'm in during the loop.
So, if you have a 2d array of:
[1][2][3][4]
[5][6][7][8]
[9][a][b][c]
Looping through would look like:
1, 2, 3, 4, 8, c, b, a, 9, 5, 6, 7
See if you can solve it using VBA and excel. I attached my example, so don't open the code if you want to solve it yourself.
Good luck and have fun! 
EDIT: Oh, and please attach a workbook and not your code example, so other people can try without the (easier) temptation to cheat!

New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules