Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to Chip Pearson's guide (http://cpearson.com/excel/vbe.htm),
I've got some code working where I can create buttons at the top of a worksheet's columns that allow the user to toggle the sort sequence of the entire sheet based on that column. Maybe I've been drinking too much coffee again... or maybe I just don't have enough to do... but it's occurred to me that it would be nice to have some visual indication of the sort status/functionality. Right now I'm just putting an invisible rectangle over the column header cell as in: -------------------------------------------------------------------- With myCell Set myRect = .Parent.Shapes.AddShape(Type:=gExcelShape_Rectangl e, Top:=.Top, Height:=.Height, Width:=.Width, Left:=.Left) End With With myRect .OnAction = theMacroName .Fill.Visible = False .Line.Visible = False End With -------------------------------------------------------------------- What I'd really like to have up there is one or more objects that tell the user that ---------------------------------------------- a) They have sorted on that particular column b) What sequence the sort is in ---------------------------------------------- From the user's perspective, I picture a little triangle in the lower right of the column header that becomes visible when the sheet is sorted on that column and invisible when the sheet is sorted on another column (whose header then shows *it's* triangle). Then, to add a little more, I see the triangle pointing down if the column is sorted ASC and pointing up if the column is sorted DESC. All I can think of is three objects instead of one on each column: ---------------------------------------- - The existing transparent rectangle that still fires the click events to invoke the sort routine - A triangle (bitmap?) pointing upwards - A triangle pointing downwards ---------------------------------------- Then the sort routine would somehow make the rectangles visible/invisible or move them Front/Back as needed to represent the .Sorted state. I'm wondering if greater minds than mine have been here. Anybody heard of doing something like this? -- PeteCresswell |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a template for this sort of thing? | New Users to Excel | |||
Sort Button | Excel Discussion (Misc queries) | |||
Lookup sort of thing! | Excel Worksheet Functions | |||
sort button,macro, or ? | Excel Programming | |||
Add Sort button | Excel Programming |