Get Sort Criteria

D

Dean C

We have defined Gantt bars that apply to all views. I recently made a change
to the standard Gantt bars and want to populate all views with the updated
Gantt bars. I'm writing a macro to copy Gantt bar definitions from one view
to other all other views by getting view definition information, deleting the
view, copying the updated view, renaming the copy to the deleted view name,
then adding the filter, group, table and sort information. I want to avoid
using send keys to capture the current source.
Is it possible to get the View Sort criteria from someplace?
 
J

Jack Dahlgren

Sort is a function, not a property, so I do not think it is anything that you
can read.
You could figure it out sort of if you read the rows and compare against ID
you can find if there is a non-standard sort applied. But it would be a
pretty complex bit of code to be sure you could determine if there is a sort
based on more than just the basics (ID, Start, Finish, Priority)

-Jack Dahlgren
 
D

Dean C

Thanks. Determining that a sort is in place can be confirmed with
SelectSheet
lastid = 0
For Each mytask In ActiveSelection.Tasks
myid = mytask.ID
If myid < lastid Then MsgBox "View is Sorted. Update view manually."
lastid = myid
Next mytask

I can repeat the current sort method with
Sendkeys "%pss~"

Is there any way of capturing the results of the sort that was performed in
response to the SendKeys command?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top