Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Make Sheet1 active
  2. Plan2.Activate
  3.  
  4. Dim LastRow As Long
  5.     With ActiveSheet
  6.         LastRow = .Cells(.Rows.count, "A").End(xlUp).Row
  7.     End With
  8.  
  9. Dim count As Integer
  10. count = 5
  11.  
  12. 'Coluna que vai receber a soma A=1, B=2, C=3...
  13. Dim colunaSoma As Integer
  14. colunaSoma = 9 'I=9
  15.  
  16. While count <= LastRow
  17.     'Soma todas as contas e coloca na Coluna = colunaSoma
  18.    Cells(count, colunaSoma).Value = Cells(count, 2).Value + Cells(count, 3).Value + Cells(count, 4).Value + Cells(count, 5).Value + Cells(count, 6).Value + Cells(count, 7).Value + Cells(count, 8).Value
  19.    
  20.     'Contador que pula linha por linha
  21.    count = count + 1
  22. Wend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement