count milestones

A

anne

Hi,

does anybody knom how to count milestones in Project? I
tried
CountMilestone =
projekt.Application.ActiveProject.Milestone.Count

Dim ml As String
Dim i As Integer
Dim CountMilestone As Integer

For i = 1 To CountMilestone
Sheets("Tabelle1").Range("C3").Offset(i, 0) = ml
Next i

I found no solution.
Anne
 
J

Jan De Messemaeker

Hallo Anne,

Milestone is a property of a task, not of a project!
Again, I have to advise you to look up the help in the Object Browser.
By all means, the following code will help you:


MlstCtr=0
For each anytask in activeproject.tasks
if not anytask is nothing then
if anytask.milestone then
MlstCtr=MlstCtr+1
endif
endif
next anytask

Gruess,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
Project Management Consultancy
Prom+ade BVBA
32-495-300 620
 
J

Jan De Messemaeker

Hello Anne,

Best is to set the format of the cell in Excel
Whatever else you do, theree is always the possibility that Excel formats it
the way it wants (I hate Excel for that)

The DateFormat method generates a string result formatted along the MS
project option, but even then the probability that Excel would respect that
string format seems low.
Haven't tried it - I only program Excel when I really have to.

HTH
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
Project Management Consultancy
Prom+ade BVBA
32-495-300 620
 

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