Notifications
Clear all

Carregar Textbox ao Inicializar Formulario

3 Posts
2 Usuários
0 Reactions
1,143 Visualizações
(@luc1-2)
Posts: 0
New Member
Topic starter
 

Boa noite, a todos!

estou precisando de ajuda, para carregar as textbox que vou enviar formulário em anexo, achei esse código e adaptei as minhas necessidades, poderem ele estava carregando uma textbox que é a soma total, mas precisaria carregar mais 3 (qtd Pedido ) (Valor da Entrada) e (Valor da Parcela), só que não estou conseguindo adaptar o codigo para carregar as outras textbox que necessito..
Se alguém puder me ajudar agradeço...

Atenciosamente
Luciano.

 
Postado : 29/08/2016 7:53 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Experimente alterar sua rotina carregalistview assim:

''****Carrega os dados na listbox
Private Sub PreencherListview7()

ListView7.ListItems.Clear
Plan1.Select

Dim linha As Integer
Dim SomaT As Double, SomaP As Double, SomaE As Double
Dim SomaQp As Long
linha = 2
Dim item As ListItem

ListView7.ListItems.Clear
LinhaFinal = Plan1.Cells(Rows.Count, 1).End(xlUp).Row

For linha = 2 To LinhaFinal
    If Plan1.Cells(linha, 89) = "" Then
              
        Set item = ListView7.ListItems.Add(Text:=Plan1.Cells(linha, 1))
            item.SubItems(1) = Plan1.Cells(linha, 2)
            item.SubItems(2) = Plan1.Cells(linha, 3)
            item.SubItems(3) = Plan1.Cells(linha, 4)
            SomaQp = SomaQp + Plan1.Cells(linha, 4)
            item.SubItems(4) = Format(Plan1.Cells(linha, 5), "currency")
            SomaT = SomaT + Plan1.Cells(linha, 5)
            item.SubItems(5) = Format(Plan1.Cells(linha, 6), "currency")
            SomaE = SomaE + Plan1.Cells(linha, 6)
            item.SubItems(6) = Format(Plan1.Cells(linha, 7), "currency")
            SomaP = SomaP + Plan1.Cells(linha, 7)
            item.SubItems(7) = Plan1.Cells(linha, 8)
            item.SubItems(8) = Plan1.Cells(linha, 9)
            item.SubItems(9) = Plan1.Cells(linha, 10)
            item.SubItems(10) = Plan1.Cells(linha, 11)
            item.SubItems(11) = Plan1.Cells(linha, 12)
            item.SubItems(12) = Plan1.Cells(linha, 13)
            item.SubItems(13) = Plan1.Cells(linha, 14)
            item.SubItems(14) = Plan1.Cells(linha, 15)
            item.SubItems(15) = Plan1.Cells(linha, 16)
            item.SubItems(16) = Format(Plan1.Cells(linha, 18), "currency")
            item.SubItems(17) = Plan1.Cells(linha, 19)
            item.SubItems(18) = Plan1.Cells(linha, 20)
            item.SubItems(19) = Plan1.Cells(linha, 21)
            item.SubItems(20) = Plan1.Cells(linha, 22)
            item.SubItems(21) = Plan1.Cells(linha, 23)
            item.SubItems(22) = Format(Plan1.Cells(linha, 25), "currency")

                item.SubItems(23) = Plan1.Cells(linha, 26)
                item.SubItems(24) = Plan1.Cells(linha, 27)
                item.SubItems(25) = Plan1.Cells(linha, 28)
                item.SubItems(26) = Plan1.Cells(linha, 29)
                item.SubItems(27) = Plan1.Cells(linha, 30)
                item.SubItems(28) = Format(Plan1.Cells(linha, 32), "currency")

                item.SubItems(29) = Plan1.Cells(linha, 33)
                item.SubItems(30) = Plan1.Cells(linha, 34)
                item.SubItems(31) = Plan1.Cells(linha, 35)
                item.SubItems(32) = Plan1.Cells(linha, 36)
                item.SubItems(33) = Plan1.Cells(linha, 37)
                item.SubItems(34) = Format(Plan1.Cells(linha, 39), "currency")

                item.SubItems(35) = Plan1.Cells(linha, 40)
                item.SubItems(36) = Plan1.Cells(linha, 41)
                item.SubItems(37) = Plan1.Cells(linha, 42)
                item.SubItems(38) = Plan1.Cells(linha, 43)
                item.SubItems(39) = Plan1.Cells(linha, 44)
                item.SubItems(40) = Format(Plan1.Cells(linha, 46), "currency")

                item.SubItems(41) = Plan1.Cells(linha, 47)
                item.SubItems(42) = Plan1.Cells(linha, 48)
                item.SubItems(43) = Plan1.Cells(linha, 49)
                item.SubItems(44) = Plan1.Cells(linha, 50)
                item.SubItems(45) = Plan1.Cells(linha, 51)
                item.SubItems(46) = Format(Plan1.Cells(linha, 53), "currency")

                item.SubItems(47) = Plan1.Cells(linha, 54)
                item.SubItems(48) = Plan1.Cells(linha, 55)
                item.SubItems(49) = Plan1.Cells(linha, 56)
                item.SubItems(50) = Plan1.Cells(linha, 57)
                item.SubItems(51) = Plan1.Cells(linha, 58)
                item.SubItems(52) = Format(Plan1.Cells(linha, 60), "currency")

                item.SubItems(53) = Plan1.Cells(linha, 61)
                item.SubItems(54) = Plan1.Cells(linha, 62)
                item.SubItems(55) = Plan1.Cells(linha, 63)
                item.SubItems(56) = Plan1.Cells(linha, 64)
                item.SubItems(57) = Plan1.Cells(linha, 65)
                item.SubItems(58) = Format(Plan1.Cells(linha, 67), "currency")

                item.SubItems(59) = Plan1.Cells(linha, 68)
                item.SubItems(60) = Plan1.Cells(linha, 69)
                item.SubItems(61) = Plan1.Cells(linha, 70)
                item.SubItems(62) = Plan1.Cells(linha, 71)
                item.SubItems(63) = Plan1.Cells(linha, 72)
                item.SubItems(64) = Format(Plan1.Cells(linha, 74), "currency")

                item.SubItems(65) = Plan1.Cells(linha, 75)
                item.SubItems(66) = Plan1.Cells(linha, 76)
                item.SubItems(67) = Plan1.Cells(linha, 77)
                item.SubItems(68) = Plan1.Cells(linha, 78)
                item.SubItems(69) = Plan1.Cells(linha, 79)
                item.SubItems(70) = Format(Plan1.Cells(linha, 81), "currency")

                item.SubItems(71) = Plan1.Cells(linha, 82)
                item.SubItems(72) = Plan1.Cells(linha, 83)
                item.SubItems(73) = Plan1.Cells(linha, 84)
                item.SubItems(74) = Plan1.Cells(linha, 85)
                item.SubItems(75) = Plan1.Cells(linha, 86)
                item.SubItems(76) = Format(Plan1.Cells(linha, 88), "currency")
                
                
         End If
    Next

'
lbl_registros = Me.ListView7.ListItems.Count & "  Registros Localizados"
Me.txt_total = FormatNumber(SomaT, 2)
Me.TextBox3 = SomaQp
Me.TextBox2 = FormatNumber(SomaE, 2)
Me.TextBox4 = FormatNumber(SomaP, 2)

End Sub
 
Postado : 30/08/2016 10:50 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Alem da sugestão do colega Reinaldo, de uma olhada na resposta referente a mesma questão que você postou em outro forum.

http://www.tomasvasquez.com.br/forum/vi ... 654#p19654

E se a resposta foi últil para você, por gentileza, clique na mãozinha ao lado direito da sua tela, no canto superior agradecendo os que ajudam, muitos não respondem ´devido a falta de consideração dos solicitantes.

[]s

Mauro Coutinho
Administrador

 
Postado : 30/08/2016 1:01 pm