Bom dia,
Gostaria de botar um total de soma numa coluna que tem o seguinte código:
O total é da coluna "G6" até o "G53".
tem que somar da G6 até o ultimo dado da "G" ou até "g53"
Obrigado, HenriqueIf Me.Text_valortotal <= "0" Then
MsgBox "FAÇA UMA PESQUISA PARA PROSEGUIR", vbInformation
Exit Sub
End If
CONFIRMAR = _
MsgBox("DESEJA IMPRIMIR O RELATORIO DE VENDAS ?", vbYesNo + vbQuestion)
If CONFIRMAR = vbNo Then
Exit Sub
End If
Dim i As Integer
Dim cont As Integer
i = 5
Set BANCO = OpenDatabase(ThisWorkbook.Path & "/" & ThisWorkbook.Name, False, False, "Excel 8.0")
Set TABELA = BANCO.OpenRecordset("select * from [RELATORIO$];")
Plan5.Range("A7:H65000").ClearContents
For cont = 0 To Me.ListBox_produto.ListCount - 1
Plan5.Range("A" & i + 1) = Me.ListBox_produto.List(cont, 1)
Plan5.Range("B" & i + 1) = Format(Me.ListBox_produto.List(cont, 2), "MM/DD/YYYY")
Plan5.Range("C" & i + 1) = Me.ListBox_produto.List(cont, 3)
Plan5.Range("D" & i + 1) = Me.ListBox_produto.List(cont, 4)
Plan5.Range("E" & i + 1) = Me.ListBox_produto.List(cont, 5)
Plan5.Range("F" & i + 1) = Me.ListBox_produto.List(cont, 6)
Plan5.Range("G" & i + 1) = Me.ListBox_produto.List(cont, 7)
Plan5.Range("H" & i + 1) = Me.ListBox_produto.List(cont,
i = i + 1
Next
Plan5.Range("G2").Value = Me.Text_valortotal
Plan5.Range("C3").Value = Me.Label_data
Plan5.Range("F4").Value = Me.Text_datainicial
Plan5.Range("H4").Value = Me.Text_datafinal
Application.ScreenUpdating = False
Plan5.Visible = True
Plan5.Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Plan1.Activate
MsgBox " O relatório foi gerado com sucesso!", vbInformation
ThisWorkbook.Save
Plan5.Visible = False
Me.Command_sair.SetFocus