Descricao: |
Escola Saberexcel VBA Estudos® - Treinamentos com Macros, Fórmulas e Funções
 Este Macro e Procedimentos do Aplicativo Microsoft Excel VBA(Visual Basic Application), realiza uma soma automaticamente ao digitar na coluna(b), retorna a soma na celula(c2). usando o evento Worksheet_Change 'ao escrever, alterar' celulas em area especifica.
Private Sub Worksheet_Change(ByVal Target As Range) x = Range("c" & Rows.Count).End(xlUp).Row If Not Intersect(Range("C2:C" & x), Target) Is Nothing Then sbx_somar_valores End If End Sub ' Sub sbx_somar_valores() Dim i As Integer For i = 2 To Cells(Rows.Count, "c").End(xlUp).Row + 1 tSoma = tSoma + Cells(i, "c").Value Next i [e2].Value = tSoma End Sub
 Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Escola Saberexcel VBA Estudos® - Treinamentos com Macros, Fórmulas e Funções.

|