Adding a sort button using VBA
I am trying to sort data by clicking on the column headers of a table
so far, the data will sort but it sorts when you click on any of the column cells. I would like
to be able to just click on the headers, so that:
Name = by forename A to Z
Year = 2, 1 then Fn
Class = Emerald, Gold, Ruby, Sapphire, Amber, Aqua, Crimson, Turquoise, Blue, Green, Purple, Red, Yellow
SEN Stage = Statement, School Action+, School Action + (SALT), School Action, Initial Concern
At the moment, when I click on the Year column header, it sorts in the order of 1, 2, Fn or Fn, 2, 1 (I would like, Fn, 1, 2 and 2, 1, Fn)
I am rather out of my depth here, any help would be grately appreciated!
Here is a link to the file
When I protect the cells and then click on them to test if they are locked I get this message "Debugging"
and this line of the code is highlighted in Yellow;
Target.CurrentRegion.Sort key1:=Target, order1:=MySortType, Header:=xlYes
Last edited by mj_bowen; 06-17-2012 at 10:12 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1