- 帖子
- 529
- 主題
- 56
- 精華
- 0
- 積分
- 607
- 點名
- 114
- 作業系統
- win 10
- 軟體版本
- []
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2013-3-19
- 最後登錄
- 2025-5-16
           
|
6#
發表於 2016-6-2 08:01
| 只看該作者
回復 5# Scott090
使用說明沒講清楚的東東
限制式內含定義名稱的寫法:
通常 : SolverAdd CellRef:="$AV$6", Relation:=2, Formulatext:=1 '..... 式(1) 其中 "$AV$6" 代表的是儲存格的位置
假如 定義了一個 range 物件 range("AV6: AV10") 的名稱 是 "Name1" ,則
SolverAdd CellRef:=[Name1].rows(1).address, Relation:=2, Formulatext:=1 '的意義和 式(1) 完全一樣
SolverAdd CellRef:=[Name1].rows(1).address, Relation:=2, Formulatext:= "=1" '的意義和 式(1) 完全一樣
SolverAdd CellRef:=[Name1].rows(1), Relation:=2, Formulatext:= "=1" '的意義和 式(1) 完全一樣
SolverAdd CellRef:="Name1", Relation:=2, Formulatext:=1 'Name1 內每一格儲存格的值 都被限制為 "= 1"
SolverAdd CellRef:="Name1", Relation:=1, Formulatext:=1 '.... 式(2) Name1 內每一格儲存格的值 都被限制為 "<= 1"
SolverAdd CellRef:=[Name1], Relation:=1, Formulatext:=1 '和式(2)意義相同 |
|