Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. Dim sum As Integer
  2. sum = 0
  3. For Each cel In Range(Cells(1, 1), Cells(10, 1))
  4. If (cel.Value = 0) Then
  5. cel.Value = ""
  6. End If
  7. Next cel
  8.  
  9. For Each cel In Range(Cells(1, 1), Cells(10, 1))
  10. If (cel.Value > 0) Then
  11. sum = sum + cel.Value
  12. End If
  13. Next cel
  14. Range(Cells(1, 1), Cells(11, 1)).Cells(11, 1) = sum
  15. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement