Share via


Task.FixedCost プロパティ (Project)

タスクの固定コストを取得または設定します。 値の取得と設定が可能なバリアント型 (Variant) の値です。

構文

FixedCost

Task オブジェクトを表す変数。

次の使用例は、マークされているタスクの固定コストを、ユーザーが指定した金額だけ増やします。

Sub IncreaseFixedCosts() 
 
 Dim T As Task ' Task object used in For Each loop 
 Dim Entry As String ' Amount to add to any existing fixed cost 
 
 Entry = InputBox$("Increase the fixed costs of marked tasks by what amount?") 
 
 ' If entry is invalid, display error message and exit Sub procedure. 
 If Not IsNumeric(Entry) Then 
 MsgBox ("You didn't enter a numeric value.") 
 Exit Sub 
 End If 
 
 ' Increase the fixed costs of marked tasks by the specified amount. 
 For Each T In ActiveProject.Tasks 
 If T.Marked Then 
 T.FixedCost = T.FixedCost + Val(Entry) 
 End If 
 Next T 
 
End Sub

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。