Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Makro1()
  2. '
  3. ' Makro1 Makro
  4. '
  5. kapital = 10000
  6. ilosc_akcji = 0
  7.  
  8. For i = 17 To 2866
  9.     If Cells(i, 17).Value = "sprzedaj" Then
  10.         kapital = kapital + ilosc_akcji * Cells(i + 1, 3).Value
  11.         ilosc_akcji = 0
  12.         kapital = kapital + ilosc_akcji * Cells(i + 1, 3).Value
  13.     End If
  14.  
  15.     If Cells(i, 18).Value = "kup" Then
  16.         ilosc_akcji = Int(kapital / Cells(i + 1, 3).Value)
  17.         kapital = kapital - ilosc_akcji * Cells(i + 1, 3).Value
  18.     End If
  19.    
  20. Next i
  21.  
  22. If (ilosc_akcji > 0) Then
  23.     kapital = kapital + ilosc_akcji * Cells(i + 1, 6).Value
  24. End If
  25.     Cells(1, 19).Value = kapital
  26.     Cells(i, 20).Value = ilosc_akcji
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. '
  34.    Range("Q1:R2866").Select
  35. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement