Auto-Sorting in EXCEL


Legendary member
I've got a 16X2 (RC) bunch of data (pivot points etc.) that I'd like to sort on a dynamic basis (it's a DDE driven spreadsheet).

Does anyone know how I can have this data sort automatically? Even a manually initiated sort function would be better than the current copy&paste&sort.


You should be able to use a Macro that will do it for you. Without seeing the spreaadsheet it is difficult to see exactly what you would need it to do.



Senior member
By what criteria are you trying to sort data? is it by some ascending or descending series ?


Legendary member
Thanks Paul.

I thought it would have to be a manually executed macro of some kind, but my technical abilities with EXCEL are fairly limited.

I'll have a play around with that possibility, but if anyone has any suggestions for a dynamically initiated sort function...


Legendary member
twalker said:
By what criteria are you trying to sort data? is it by some ascending or descending series ?

For example:-

R2 1907
HIGH 1888
R1 1870
HL4 1863
PP 1850
HL3 1848
HL2 1842
HL1 1837
CLOSE 1832
LOW 1831
LL1 1827
LL2 1822
LL3 1816
S1 1813
LL4 1801
S2 1793

These data are collated from discontiguous areas of the same sheet. They are pasted links.

I would like to sort on the nummeric value, taking the appropriate label with each data.

So it would be a sort on the second column, descending.

But I'd need to sort a copy of them otherwise the paste links would end up giving me a #REF error.


Legendary member
OK - I have written a manually executed sort macro.

But if anyone has ideas on the dynamic update side, much appreciated.


Active member

I think you probably want to call your manual macro from the 'Worksheet_Calculate' event - when your worksheet calculates it will run.

From the VB editor, go to Project Explorer, double click the worksheet name where your data is, this should open a code window for that worksheet. In the left-hand dropdown at the top, pick 'Worksheet', in the right hand dropdown, pick 'Calculate'. This should create your subroutine, just add a line to call your macro.




Legendary member
Thanks MC.

I got as far as "add a line to call your macro" - (erm :eek: ), how exactly do I code that?

I've got the manual macro execution currently linked to Ctrl-Q.


Active member
Hmm, apologies TB. I forgot it's more complicated than that. I have managed to make it work previously though, but I'm struggling to put together a sample for you.

I'll PM you my email, if you can let me have a sample of your file, I'll have a bash.

AdBlock Detected

We get it, advertisements are annoying!

But it's thanks to our sponsors that access to Trade2Win remains free for all. By viewing our ads you help us pay our bills, so please support the site and disable your AdBlocker.

I've Disabled AdBlock    No Thanks