Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub teste()
  2.  
  3. Dim Preco, MaxPreco, MaxCu, cu, Quantidade, Variacao As Double
  4. Dim linha As Integer
  5.  
  6. Dim PrecoIndex, CuIndex, QuantidadeIndex as Double
  7.  
  8. 'Console.WriteLine("linha | preco |   cu |   quantidade")
  9.  
  10. Linha = 4
  11.  
  12. Preco = 40
  13. MaxPreco = 100
  14.  
  15. cu = 15
  16.  
  17. Quantidade = 50
  18. Variacao = 150
  19.  
  20. MaxCu = MaxPreco
  21.  
  22. For PrecoIndex = Preco To MaxPreco
  23.   For CuIndex = cu To MaxCu
  24.     For QuantidadeIndex = Quantidade To Quantidade + Variacao
  25.         'Console.WriteLine("{0:D}        {1:N}     {2:N}      {3:N}", Linha, PrecoIndex, CuIndex, QuantidadeIndex)    
  26.      
  27.        Cells(linha, 4).Value = PrecoIndex
  28.        Cells(linha, 5).Value = CuIndex
  29.        Cells(linha, 6).Value = QuantidadeIndex
  30.    
  31.       Linha = Linha + 1
  32.     Next
  33.   Next  
  34. Next
  35.  
  36. 'Console.WriteLine("{0:D}        {1:N}     {2:N}      {3:N}", Linha, 0, 0, 0)    
  37.  
  38.  
  39. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement