Using VBA applied filter output

S

seanpears99

Hi everyone

Due to task selection limitations as posted previously, I wonder if
anyone an help.

I am now having to apply a filter in VBA (using one I have already
created) and then work down the output (if unique id <> blank a = a + 1
then select rowid + height (a)) to select all of the tasks for a
editcopypicture object to copy out to a gif.

The problem is, when I apply the filter and scan for the end of the
last task, it isnt using the filtered output so I am going way past
where I need to select to extract.

Is there a used lines count which will work when the filter is on?

(I normally use Excel VBA so I am struggling)

Many thanks

Sean
 
M

Mike Glen

Hi Sean,

You might like to try posting on the microsoft.public.project.developer
newsgroup (forum). 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

John

seanpears99 said:
Hi everyone

Due to task selection limitations as posted previously, I wonder if
anyone an help.

I am now having to apply a filter in VBA (using one I have already
created) and then work down the output (if unique id <> blank a = a + 1
then select rowid + height (a)) to select all of the tasks for a
editcopypicture object to copy out to a gif.

The problem is, when I apply the filter and scan for the end of the
last task, it isnt using the filtered output so I am going way past
where I need to select to extract.

Is there a used lines count which will work when the filter is on?

(I normally use Excel VBA so I am struggling)

Many thanks

Sean

Sean,
Mike is right in that Project VBA questions are best posted in the
developer newsgroup. However, let me provide a quick answer since I
normally check this newsgroup before I check the developer group.

When looping through a filtered set of tasks in VBA the best approach is
to use the following loop structure:

Dim t as Task
[Apply your filter]
SelectTaskColumn
For Each t in ActiveSelection.Tasks

Generally I find that Excel VBA has much more flexibility but this is
one area where Project VBA takes the "prize". Hope this helps.

John
Project MVP
 

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