Advertisement
Guest User

Kudlai

a guest
Dec 12th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Solver()
  2.     Row = 7
  3.     Col = 2
  4.     MinVal = 99999
  5.     MinI = MinVal
  6.     MinJ = MinVal
  7.     MinK = MinVal
  8.     For i = 700 To 900
  9.         Cells(Row, Col) = i
  10.         If Int(Cells(6, 2)) = Cells(6, 2) And Cells(5, 2) <= Cells(4, 2) Then
  11.             For j = 200 To 300
  12.                 Cells(Row, Col + 1) = j
  13.                 If Int(Cells(6, 3)) = Cells(6, 3) And Cells(5, 3) <= Cells(4, 3) Then
  14.                     For k = 1000 To 1300
  15.                         Cells(Row, Col + 2) = k
  16.                         Value = Cells(7, 6)
  17.                         If Int(Cells(6, 4)) = Cells(6, 4) And Cells(5, 6) = Cells(5, 8) And Cells(6, 6) <= Cells(6, 8) And Cells(5, 4) <= Cells(4, 4) And Value < MinVal Then
  18.                             Debug.Print "Yay!"
  19.                             MinVal = Value
  20.                             MinI = i
  21.                             MinJ = j
  22.                             MinK = k
  23.                         End If
  24.                     Next k
  25.                 End If
  26.             Next j
  27.         End If
  28.     Next i
  29.     Cells(Row, Col) = MinI
  30.     Cells(Row, Col + 1) = MinJ
  31.     Cells(Row, Col + 2) = MinK
  32. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement