except tasks from sorting

U

uli

Hello fellow sufferers (maybe from project, maybe from this
question...)

(Project 2002 and 2003) I'm sorting tasks via vba, sort key is a Text
Field (so good as any other field). Sorting is no problem. But I will
except some manually to mark tasks from (repeated) sorting (for example
tasks with field flag1 "no").

I read a lot of it in the web and newsgroups, so many times I found the
hint to filtering the tasks (with autofilter or other filters) before
sorting. These hints assure: only the filtered part will be sorted.

But I never found any difference between filtering before sorting or
not: after filtering, then sorting, and then refiltering always all
tasks are sorted by the sorting key.

So the question is: Don't I understand this hints (filtering before
sorting) wrong - or doesn't this work?

So it stays my problem: How can I except some tasks from sorting
(whatever position ms-project the "non sorted" tasks then leave - but
not a position via sort key)

greetings uli from Germany
 
M

Mike Glen

Hi Uli,

If you're having problems with vba, try posting on the developer newsgroup.
Please see FAQ Item: 24. Project Newsgroups. FAQs, companion products and
other useful Project information can be seen at this web address:
http://project.mvps.org/faqs.htm

Mike Glen
Project MVP
 
J

Jack Dahlgren

A simple answer would be use another field.
Your code would copy the text field to the new field first - EXCEPT for the
ones with a flag indicating that they should not be sorted. For those put
something guaranteed to be first in a sort order. I usually use the
underscore _ for this. Then sort on the new column. When you are done, clear
the field so you can use it again.

the code would look something like this:

if not task.text1 = "NO SORT" then
task.text2 = task.text1
Else task.text2 = "_not sorted"


-Jack Dahlgren
 
R

Rob Schneider

Uli,

As Mike indicated, try posting on the developer newsgroup, which is
where there are conversations about devlopment and VBA.
 
U

uli

Hi Jack,

firstly thanks for your efforts. Let me clarify my first assumption (to
simplify the problem assume that we have only one level of tasks (only
level one-tasks)):

The user drags a task and drops it on an arbitrary position - id est a
position out of any sort key. If this happens after ore without any
sorting, we have no problem: the before moved task stays at its
position.

But we will sorting subsequently.

Therefore we need a critera (or via code testable event or state) not
to sort the formentioned arbitrary moved task - we will sort only the
tasks without "not to sort" criteria.

To sort that way, "not to sort" tasks collecting on the beginning or
end of all tasks will be easy - and I understand your code-example to
work that way (you are not angrily, that I say, this of your code will
be easy...)

But the challenge is, to find an vba-code, which sorts ONLY "allowed"
tasks and "forgets" "not to sort" tasks - they stay at their before
(relative) position.

So I assume there must be ms-project code like only sorting the
"active.region" "current.region" "selection" ore analogous, but I
couldn't find the right syntax or logic or ansatz.

So perhaps I had to post the problem thematically in the developers
group? yours Uli
 
U

uli

Hi Rob,

thanks, ok, i will do so (can I MOVE the posting to the developers
group, so that it will not remain in this group?),

yours Uli
 
R

Rob Schneider

I guess that depends fully on the software you are using to access the
newsgroups. I'd suggest resubmitting, to keep it simple.
 

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