move to task that is empty

R

Ruth

My goal is to move the activecell to the first empty task in the
project, in other words to the end of the project plus one. This is
what I've tried so far:

Dim t As Task
Dim num As Long
For Each t In ActiveProject.Tasks
num = t.UniqueID
If num = 0 Then
EditGoTo ID:=ActiveProject.Tasks(num).UniqueID
Call openpfile
Call buildparrays
End If
Next t

Project nevers finds a unique id of 0(zero) plus I've tried
NOT(isnumeric(t))

and I've also tried

t.name = ""

Any suggestions, your help is greatly appreciated!
 
J

Jan De Messemaeker

Hi,

Set Nutask=activeproject.tasks.add("New Name")
There you are, use Nutask.
HTH
 
R

Ruth

I'm not trying to add a new task to the end of the task list in MS
Project I'm just trying to make the first empty row/task an activecell.
Is it possible to refer to an empty cell and activate it? I tried
posting this question in the VBA section but it didn't go through.

Thanks for your help Jan
 
J

Jan De Messemaeker

Hi,

I don't think you can refer to a cell in an empty task. You can easily refer
to empty cell in an existing task that is why I create one on that spot.
Once you put ANYTHING in the cell Project will create the task anyhow.

And why, oh why, do people want to address cells? VBA Project is about
tasks, resoruce, assignments, cells are only relevant for formatting.
HTH
 
R

Ruth

To address cells is part of a programming structure in order to
manipulate the resources, tasks, assignments. Do you do much
programming?
 
R

Ruth

I was able to get this answer from a previous posting back in Feb 04.


Sub DeleteBlank()
Dim oTache As Object
Dim i As Integer


For Each oTache In ActiveProject.Tasks
If Not oTache Is Nothing Then
'Debug.Print oTache.ID, oTache.Name
i = oTache.ID + 1
Else
SelectTaskField Row:=i, RowRelative:=False, Column:="Name"
SetTaskField Field:="Name", Value:="anything"
ActiveProject.Tasks(i).Delete
End If


Next


End Sub
 

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