• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel sort event handler

pmc086

New Member
Hi all,

I have some VBA code that works well, however, I want it to trigger only when a table (there is only one table so doesn't need to be specific to this table) is sorted.

Is there any way I can capture this event?

I've had a look and the only thing I can find is the following page:

http://blogs.msdn.com/b/vsto/archiv...and-filter-events-in-excel-navneet-gupta.aspx

They suggest capturing a sheet change event right before a sheet calculate event as a way of excluding calculations that are not the sort event (a sort event only triggers the calculate event). The issue I have is that it appears that the calculate event runs before the change event meaning that I have no idea how to capture whether a change was done prior to running my desired macro within the calculate event.

Given the simplicity of my sheet and that it will always be in automatic calculation, I don't really want to go about repurposing commands (the second solution suggested in the link) as I don't have any experience with this and if I can get the first suggestion working, would be sufficient for my needs.

Any suggestions on this would be greatly appreciated as I really don't want to have to run this macro every time the sheet performs a calculation.

Thanks.
 
Back
Top