PhạmNhi2811
Thành viên mới
- Tham gia
- 11/6/24
- Bài viết
- 3
- Được thích
- 3
Sub Solve()
SolverOk SetCell:="D73", MaxMinVal:=1, ValueOf:="0", ByChange:="D4069"
SolverSolve UserFinish:=True
End Sub
Sub Bankhongdoit()
Range("ketqua").ClearContents
For counter = 1 To 30
Range("hangso") = -0.005 + counter * 0.0003
Solve
Application.SendKeys ("{Enter}")
Range("ketqua").Cells(counter, 1) = ActiveSheet.Range("hangso")
Range("ketqua").Cells(counter, 2) = ActiveSheet.Range("dlc")
Range("ketqua").Cells(counter, 3) = ActiveSheet.Range("tssl_")
Range("ketqua").Cells(counter, 4) = ActiveSheet.Range("x_1")
Range("ketqua").Cells(counter, 5) = ActiveSheet.Range("x_2")
Range("ketqua").Cells(counter, 6) = ActiveSheet.Range("x_3")
Range("ketqua").Cells(counter, 7) = ActiveSheet.Range("x_4")
Range("ketqua").Cells(counter, 8) = ActiveSheet.Range("x_5")
Range("ketqua").Cells(counter, 9) = ActiveSheet.Range("x_6")
Range("ketqua").Cells(counter, 10) = ActiveSheet.Range("x_7")
Range("ketqua").Cells(counter, 11) = ActiveSheet.Range("x_8")
Range("ketqua").Cells(counter, 12) = ActiveSheet.Range("x_9")
Range("ketqua").Cells(counter, 13) = ActiveSheet.Range("x_10")
Range("ketqua").Cells(counter, 14) = ActiveSheet.Range("x_11")
Range("ketqua").Cells(counter, 15) = ActiveSheet.Range("x_12")
Range("ketqua").Cells(counter, 16) = ActiveSheet.Range("x_13")
Range("ketqua").Cells(counter, 17) = ActiveSheet.Range("x_14")
Range("ketqua").Cells(counter, 18) = ActiveSheet.Range("x_15")
Range("ketqua").Cells(counter, 19) = ActiveSheet.Range("x_16")
Range("ketqua").Cells(counter, 20) = ActiveSheet.Range("x_17")
Range("ketqua").Cells(counter, 21) = ActiveSheet.Range("x_18")
Range("ketqua").Cells(counter, 22) = ActiveSheet.Range("x_19")
Range("ketqua").Cells(counter, 23) = ActiveSheet.Range("x_20")
Range("ketqua").Cells(counter, 24) = ActiveSheet.Range("x_21")
Range("ketqua").Cells(counter, 25) = ActiveSheet.Range("x_22")
Range("ketqua").Cells(counter, 26) = ActiveSheet.Range("x_23")
Range("ketqua").Cells(counter, 27) = ActiveSheet.Range("x_24")
Range("ketqua").Cells(counter, 28) = ActiveSheet.Range("x_25")
Range("ketqua").Cells(counter, 29) = ActiveSheet.Range("x_26")
Range("ketqua").Cells(counter, 30) = ActiveSheet.Range("x_27")
Range("ketqua").Cells(counter, 31) = ActiveSheet.Range("x_28")
Range("ketqua").Cells(counter, 32) = ActiveSheet.Range("x_29")
Range("ketqua").Cells(counter, 33) = ActiveSheet.Range("x_30")
Next counter
End Sub
SolverOk SetCell:="D73", MaxMinVal:=1, ValueOf:="0", ByChange:="D4069"
SolverSolve UserFinish:=True
End Sub
Sub Bankhongdoit()
Range("ketqua").ClearContents
For counter = 1 To 30
Range("hangso") = -0.005 + counter * 0.0003
Solve
Application.SendKeys ("{Enter}")
Range("ketqua").Cells(counter, 1) = ActiveSheet.Range("hangso")
Range("ketqua").Cells(counter, 2) = ActiveSheet.Range("dlc")
Range("ketqua").Cells(counter, 3) = ActiveSheet.Range("tssl_")
Range("ketqua").Cells(counter, 4) = ActiveSheet.Range("x_1")
Range("ketqua").Cells(counter, 5) = ActiveSheet.Range("x_2")
Range("ketqua").Cells(counter, 6) = ActiveSheet.Range("x_3")
Range("ketqua").Cells(counter, 7) = ActiveSheet.Range("x_4")
Range("ketqua").Cells(counter, 8) = ActiveSheet.Range("x_5")
Range("ketqua").Cells(counter, 9) = ActiveSheet.Range("x_6")
Range("ketqua").Cells(counter, 10) = ActiveSheet.Range("x_7")
Range("ketqua").Cells(counter, 11) = ActiveSheet.Range("x_8")
Range("ketqua").Cells(counter, 12) = ActiveSheet.Range("x_9")
Range("ketqua").Cells(counter, 13) = ActiveSheet.Range("x_10")
Range("ketqua").Cells(counter, 14) = ActiveSheet.Range("x_11")
Range("ketqua").Cells(counter, 15) = ActiveSheet.Range("x_12")
Range("ketqua").Cells(counter, 16) = ActiveSheet.Range("x_13")
Range("ketqua").Cells(counter, 17) = ActiveSheet.Range("x_14")
Range("ketqua").Cells(counter, 18) = ActiveSheet.Range("x_15")
Range("ketqua").Cells(counter, 19) = ActiveSheet.Range("x_16")
Range("ketqua").Cells(counter, 20) = ActiveSheet.Range("x_17")
Range("ketqua").Cells(counter, 21) = ActiveSheet.Range("x_18")
Range("ketqua").Cells(counter, 22) = ActiveSheet.Range("x_19")
Range("ketqua").Cells(counter, 23) = ActiveSheet.Range("x_20")
Range("ketqua").Cells(counter, 24) = ActiveSheet.Range("x_21")
Range("ketqua").Cells(counter, 25) = ActiveSheet.Range("x_22")
Range("ketqua").Cells(counter, 26) = ActiveSheet.Range("x_23")
Range("ketqua").Cells(counter, 27) = ActiveSheet.Range("x_24")
Range("ketqua").Cells(counter, 28) = ActiveSheet.Range("x_25")
Range("ketqua").Cells(counter, 29) = ActiveSheet.Range("x_26")
Range("ketqua").Cells(counter, 30) = ActiveSheet.Range("x_27")
Range("ketqua").Cells(counter, 31) = ActiveSheet.Range("x_28")
Range("ketqua").Cells(counter, 32) = ActiveSheet.Range("x_29")
Range("ketqua").Cells(counter, 33) = ActiveSheet.Range("x_30")
Next counter
End Sub