Somar coluna listbox em textbox
Enviado: 25 Fev 2017 às 12:29
Boa tarde
consegui desenvolver este sistema de caixa com a ajuda de tutoriais e fóruns, mas não consegui adaptar na minha planilha
quero que os valores da coluna 5 do listbox seja somada em uma textbox conforme vou adicionando mas informações
estou usando este codigo
Private Sub CmdCaixa_Click()
Dim x As Integer
x = ListBox1.ListCount
With ListBox1
.AddItem
.List(x, 0) = TxtData.Value
.List(x, 1) = TxtDescrição.Value
.List(x, 2) = TxtQntde.Value
.List(x, 3) = Format(TxtValor.Value, "currency")
.List(x, 4) = Format(TxtTotal.Value, "currency")
.List(x, 5) = TxtFornecedor.Value
.List(x, 6) = TxtObservação.Value
TxtDescrição = Clear
TxtQntde = Clear
TxtValor = Clear
TxtTotal = Clear
TxtFornecedor = Clear
TxtObservação = Clear
End With
End Sub
.List(x, 4) = Format(TxtTotal.Value, "currency") os valores seja somado na TxtTotal2 automaticamente
consegui desenvolver este sistema de caixa com a ajuda de tutoriais e fóruns, mas não consegui adaptar na minha planilha
quero que os valores da coluna 5 do listbox seja somada em uma textbox conforme vou adicionando mas informações
estou usando este codigo
Private Sub CmdCaixa_Click()
Dim x As Integer
x = ListBox1.ListCount
With ListBox1
.AddItem
.List(x, 0) = TxtData.Value
.List(x, 1) = TxtDescrição.Value
.List(x, 2) = TxtQntde.Value
.List(x, 3) = Format(TxtValor.Value, "currency")
.List(x, 4) = Format(TxtTotal.Value, "currency")
.List(x, 5) = TxtFornecedor.Value
.List(x, 6) = TxtObservação.Value
TxtDescrição = Clear
TxtQntde = Clear
TxtValor = Clear
TxtTotal = Clear
TxtFornecedor = Clear
TxtObservação = Clear
End With
End Sub
.List(x, 4) = Format(TxtTotal.Value, "currency") os valores seja somado na TxtTotal2 automaticamente