Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
87
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, Dolar, MDR As Double
  4. Dim linha As Integer
  5.  
  6. Dim PrecoIndex, CuIndex, QuantidadeIndex as Double
  7.  
  8. Linha = 4
  9.  
  10. Preco = 40
  11. MaxPreco = 100
  12.  
  13. cu = 15
  14.  
  15. Quantidade = 50
  16. Variacao = 3
  17.  
  18. MaxCu = MaxPreco
  19.  
  20. Dolar = 3.5
  21.  
  22. MDR = 2
  23.  
  24.  
  25. For PrecoIndex = Preco To MaxPreco
  26.   For CuIndex = cu To MaxCu
  27.     For QuantidadeIndex = Quantidade To Quantidade + Variacao
  28.        
  29.      
  30.        Cells(linha, 4).Value = PrecoIndex
  31.        Cells(linha, 5).Value = CuIndex
  32.        Cells(linha, 6).Value = QuantidadeIndex
  33.        'ADICIONAR DOLAR
  34.        'ADICIONAR MDR
  35.    
  36.       Linha = Linha + 1
  37.     Next
  38.     Dolar = Dolar + 0.1    
  39.    
  40.     if Dolar > 4.0 then
  41.       Dolar = 3.5
  42.     End If        
  43.    
  44.     MDR = MDR + 1
  45.    
  46.     if MDR > 4 then
  47.       MDR = 2
  48.     end If
  49.    
  50.   Next  
  51. Next
  52.  
  53.  
  54. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement