Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Turn named table on active worksheet upside down using VBA

Dear Experts:

I wonder whether it is possible by means of a VBA code to turn a list upside down.

I know the workaround:
- Insert a helper column to the very right.
- Put 1, 2, 3, 4, ... all the way down that column.
- Then select the data and sort by this column in descending order.
- Then delete the helper column.

But now I would like to know how to do this using VBA.

In my special case, I got a named table (MyTable1) on the active worksheet that should be flipped upside down.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
SOLUTION
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you give us a sample file I can provide you with a macro.
Avatar of Andreas Hermle

ASKER

Hi MacroShadow:

thank you very much for your swift help.
- I could record a macro of course, but as you know, recorded macros are often kind of  'clumsy' and or not 'very professional'
- The macro code works fine although I can flip the order (only) on one column at a time, i.e. on a 5 column list I need to run the macro 5 times.
Nevertheless, I do not want to complain. It is a great code that does excactly what I want.

I'll give ssaqibh a chance to see what he comes up with.

Regards, Andreas
ssaqibh:

here we are. Thank you very much for your help.

Regards, Andreas
Named-Table-table1-flip-upside-d.xlsx
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Brad,

works like a charm, thank you very much for your superb and professional help! I am really impressed!

ssaqibh: I was gonna try out your code but you inadvertently sent an xlsx-file that - as you know - is not able to hold any macro code.

Before awarding the points I would like to have a look at your code as well.

Again, I am really impressed at the professionalism of this forum.
Dear both,

thank you very much for your great and professional support.

Brad: very nice coding, works like a charm and will be applied by me lots of times on my working place. Thank you.