Project) (Task.PercentComplete 屬性
取得或設定任務的完成百分比。 讀取/寫入 Variant 。
語法
expression。 PercentComplete
表達 代表 Task 物件的變數。
範例
下列範例會移除包含兩項以上資源且完成百分比為 85 之任務中的其中一項資源。
Sub ReallocateResource()
Dim Entry As String ' The name of the resource to remove
Dim T As Task ' The task object used in For loop
Dim RA As Assignment ' The resource assignment object to the task
Entry = InputBox$("Enter a resource name:")
' Remove the resource from 85 percent complete tasks with 2+ resources.
For Each T In ActiveProject.Tasks
If T.PercentComplete >= 85 And T.Resources.Count >= 2 Then
For Each RA In T.Assignments
If UCase(Entry) = UCase(RA.ResourceName) Then
RA.Delete
End If
Next
End If
Next T
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應