Find bottom row fo project

A

afimike

What is the easienst way to find the botom row of a project in VBA. I have
some code that takes a bunch of indvidual projects and combines them into a
single project for reporting purposes. I was wondering if project had
anything like excels Selection.End(xlUp).Select
thx
mike
 
J

John

afimike said:
What is the easienst way to find the botom row of a project in VBA. I have
some code that takes a bunch of indvidual projects and combines them into a
single project for reporting purposes. I was wondering if project had
anything like excels Selection.End(xlUp).Select
thx
mike

afimike,
I think you mean "bottom", not "botom". Darn those clumsy fingers :)

What exactly do you mean by "find the bottom row"? Are you trying to
select it or simply want to know how many rows are in the combined
project? If you only need to know how many task rows are in the project,
use:
ActiveProject.Tasks.Count

If you want to actually select the last row in the project, use:
SelectRow row:=ActiveProject.Tasks.Count,RowRelative:=False

Hope this helps.

John
Project MVP
 
A

afimike

John

Botom, Botoom, Bottom.... if only you cold see how clumsy those fingers were

I was looking for the total number of tasks so that I could add the next set
of projects/taskes right below it, so tasks.count is what I need

thanks for your help

mike
 
J

Jan De Messemaeker

Hi,

Some warning here.
In a master project, and/or when there have been filters/sorts applied, the
bottom row is not necessarily the one with the highest task ID.

But this one is
Select all
lines=activeselection.tasks.count
set thetask=activeselection.tasks(lines)

Hope this helps,
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
J

John

afimike said:
John

Botom, Botoom, Bottom.... if only you cold see how clumsy those fingers were

I was looking for the total number of tasks so that I could add the next set
of projects/taskes right below it, so tasks.count is what I need

thanks for your help

mike
Mike,
You're welcome and thanks for the feedback.

Jan made a good point in his warning response. The methods I described
apply to a single project or to a static consolidation, which is a
single project. In a dynamic consolidation, the selection method is what
you will need.

John
Project MVP
 
A

afimike

Jan

thanks for the clarification

I have multiple smal projects I am bringing in and it wasnt quite working
right. I'll try your suggestion
 

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