Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Sub aaa()
  2.  
  3. Dim a As Double
  4. Dim i As Variant
  5. Dim suma As Double
  6. Dim j As Double
  7. suma = 0
  8.  
  9. For j = 1 To 10
  10. Cells(j, 1).Value = Clear
  11. Next j
  12.  
  13. For i = 1 To 10
  14. Cells(i, 1) = InputBox("wpisz liczbę " & i)
  15.  
  16. If Cells(1, 1) = "end" Then
  17. MsgBox ("brak danych")
  18. Exit For
  19. End If
  20.  
  21.  
  22. If i > 1 And Cells(i, 1) = "end" Then
  23. suma = suma + Cells(i - 1, 1).Value
  24. Cells(i + 1, 1) = suma
  25. Exit For
  26. Else: suma = suma + Cells(i, 1).Value
  27. Cells(i + 1, 1) = suma
  28. End If
  29.  
  30.  
  31. Next i
  32.  
  33.  
  34.  
  35.  
  36. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement