Share via

Clear all custom text fields

Anonymous
2014-02-04T15:42:01+00:00

Is there any easy way, other than displaying all the fields and deleting each cell, to delete all the data out of all the custom task text fields?

Thanks for you advice,

cb24

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

John Project 49,710 Reputation points Volunteer Moderator
2014-02-04T16:01:38+00:00

cb24,

It could be automated with VBA. The following macro will do it:

Sub ClearTskText()

Dim t As Task

Dim pst As Task

For Each t In ActiveProject.Tasks

If Not t Is Nothing Then

t.Text1 = ""

t.Text2 = ""

'continue sequence for Text3 through Text30

End If

Next t

End Sub

This version includes the Project Summary Task:

Sub ClearTskText()

Dim t As Task

Dim TFld As String

OutlineShowAllTasks

FilterApply Name:="all tasks"

GroupApply Name:="no group"

SelectAll

'this loop will cover all tasks including the Project Summary Task

For i = 1 To 30

TFld = "text" & i

SetTaskField Field:=TFld, Value:="", TaskID:=0

SetTaskField Field:=TFld, Value:="", allselectedtasks:=True

Next i

End Sub

Hope this helps.

John

Was this answer helpful?

0 comments No comments

8 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-02-04T16:38:02+00:00

    John,

    Can this be expanded to include the resource and assignment text fields?

    Thanks,

    cb24

    Was this answer helpful?

    0 comments No comments
  2. John Project 49,710 Reputation points Volunteer Moderator
    2014-02-04T16:36:20+00:00

    cb24,

    You're welcome. I responded with the first version of the macro that did not include clearing the 30 text fields for the Project Summary Task. While you were reading that response, I was working on a version to include the Project Summary Task. I have edited my response to include the expanded version.

    John

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-02-04T16:09:33+00:00

    John,

    What did you mean by " the text field of the Project Summary Task clear"?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-02-04T16:08:13+00:00

    Thanks John.

    It is much appreciated.

    Was this answer helpful?

    0 comments No comments