Otimização de Código - Copiar de varias plan.[RESOLVIDO]

LAC1891

23-07-2012 14:35:33

Bom dia Pessoal,

Estou iniciando em VBA e gostaria de uma dica para otimização de um código, tenho que realizar este procedimento em 53 arquivos cada um com 15 guias, gostaria de deixá-lo mais limpo e rápido.

explicação:
1 - ele abre a planilha desejada (no mesmo diretório)
2 - seleciona a aba desejada e a célula
3 - copia e traz para a planilha geral
4 - repete isso em + 14 abas
5 - Fecha o arquivo onde foram tirados os dados e abre um outro onde realiza este procedimento novamente.
6 - ao final fecha e salva o arquivo geral.

Possibilidade de melhoria (corrigir se a plan que contem os dados a serem retirados estiver aberta, "dá erro e não atualiza" usei a linha de código On error next resume, mas não contempla totalmente minha necesidade. Poderia tratar o erro mais com o código é da forma que contrui ficará muito grande pode ficar complexo.

segue o código em anexo:

Muito Obrigado desde já.

JValq

23-07-2012 15:52:47

Boa tarde,

Veja se atende:

Código: Selecionar todos

Sub Carga()
    Dim i As Long
    Dim Caminho As String
    Dim Pl As Worksheet
    
    Application.ScreenUpdating = False
    
    On Error GoTo ERRO
    
    Caminho = "P:\MODELO PCP FABRICA\"
    
    For i = 1 To 53
        Workbooks.Open Caminho & "PROG_" & Format(i, "00") & ".xls"
        For Each Pl In Worksheets
            Pl.Select
            Range("H36").Copy
            ThisWorkbook.Sheets("CARGA").Cells(ActiveSheet.Name / 10 + 3, i + 3).PasteSpecial xlPasteValues
        Next
        ActiveWorkbook.Close False
    Next
    Application.ScreenUpdating = True
    Exit Sub
ERRO:
    MsgBox "O erro ocorreu na planilha PROG_" & i
    Application.ScreenUpdating = True
End Sub
A macro dá carga em todas as planilhas das 53 semanas.

Abraço

LAC1891

23-07-2012 16:04:06

Boa tarde JValq,

Excelente, funcionou e, muito mais rápido, redução no tempo de 95% em relação a 5 semana, cerca de uns 400% no todo (53 semana) (perfeito)!!!
Muito obrigado, estudarei a lógica usada para aplicar em outras situações necessárias.

Grande Abraço e obrigado pelo pronto retorno!

Jairo2010

24-08-2012 00:14:46

Olá...

Preciso de uma ajuda para minimizar um código... Ou fazer subs...

Grande Tomás, salve, salve... Por onde anda?

Obrigado de já.

1º Parte...

Código: Selecionar todos

Private Sub ComboBox1_Change()
    
    Dim i As Integer        ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
     
     i = 2

    Dim k As Integer
  
     k = 2
  
    Dim m As Integer
  
     m = 2
  
txtcrediarista.Clear
txtanalistacredito.Clear
txtjustificativaanalista.Clear
  
    If Me.ComboBox1 = "LI-L01-GVARGA" Then          ''CONTAGEM DIVISÃO DE MACRO 01
  
  
    Do While Plan58.Range("i" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("i" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("k" & k) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("k" & k)
    k = k + 1
    Loop
  
  
    Do While Plan58.Range("m" & m) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("m" & m)
    m = m + 1
    Loop
    

Dim linha As Integer        '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

linha = 2

ListView1.ListItems.Clear

Do While Plan23.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan23.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan23.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan23.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan23.Range("d" & linha)
               Lista.SubItems(4) = Plan23.Range("e" & linha)
               Lista.SubItems(5) = Plan23.Range("f" & linha)
               Lista.SubItems(6) = Plan23.Range("g" & linha)
               Lista.SubItems(7) = Plan23.Range("h" & linha)
               Lista.SubItems(8) = Plan23.Range("i" & linha)
               Lista.SubItems(9) = Plan23.Range("j" & linha)
               Lista.SubItems(10) = Plan23.Range("k" & linha)
               Lista.SubItems(11) = Plan23.Range("n" & linha)
               Lista.SubItems(12) = Plan23.Range("o" & linha)


               
linha = linha + 1
Loop
    
End If

    Dim r As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     r = 2
  
    Dim t As Integer
  
     t = 2
    

    If Me.ComboBox1 = "LI-L04-JLISBO" Then          ''CONTAGEM DIVISÃO DE MACRO 02
  
  
    Do While Plan58.Range("p" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("p" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("r" & r) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("r" & r)
    r = r + 1
    Loop
  
  
    Do While Plan58.Range("t" & t) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("t" & t)
    t = t + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan24.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan24.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan24.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan24.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan24.Range("d" & linha)
               Lista.SubItems(4) = Plan24.Range("e" & linha)
               Lista.SubItems(5) = Plan24.Range("f" & linha)
               Lista.SubItems(6) = Plan24.Range("g" & linha)
               Lista.SubItems(7) = Plan24.Range("h" & linha)
               Lista.SubItems(8) = Plan24.Range("i" & linha)
               Lista.SubItems(9) = Plan24.Range("j" & linha)
               Lista.SubItems(10) = Plan24.Range("k" & linha)
               Lista.SubItems(11) = Plan24.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim y As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     y = 2
  
    Dim aa As Integer
  
     aa = 2
    

    If Me.ComboBox1 = "LI-L06-R.PAZ" Then           ''CONTAGEM DIVISÃO DE MACRO 03
  
  
    Do While Plan58.Range("w" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("w" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("y" & y) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("y" & y)
    y = y + 1
    Loop
  
  
    Do While Plan58.Range("aa" & aa) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("aa" & aa)
    aa = aa + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan1.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan1.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan1.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan1.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan1.Range("d" & linha)
               Lista.SubItems(4) = Plan1.Range("e" & linha)
               Lista.SubItems(5) = Plan1.Range("f" & linha)
               Lista.SubItems(6) = Plan1.Range("g" & linha)
               Lista.SubItems(7) = Plan1.Range("h" & linha)
               Lista.SubItems(8) = Plan1.Range("i" & linha)
               Lista.SubItems(9) = Plan1.Range("j" & linha)
               Lista.SubItems(10) = Plan1.Range("k" & linha)
               Lista.SubItems(11) = Plan.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

Dim af As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     af = 2
  
    Dim ah As Integer
  
     ah = 2
    

    If Me.ComboBox1 = "LI-L07-O.CRUZ" Then              ''CONTAGEM DIVISÃO DE MACRO 04
  
  
    Do While Plan58.Range("ad" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ad" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("af" & af) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("af" & af)
    af = af + 1
    Loop
  
  
    Do While Plan58.Range("ah" & ah) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ah" & ah)
    ah = ah + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan4.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan4.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan4.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan4.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan4.Range("d" & linha)
               Lista.SubItems(4) = Plan4.Range("e" & linha)
               Lista.SubItems(5) = Plan4.Range("f" & linha)
               Lista.SubItems(6) = Plan4.Range("g" & linha)
               Lista.SubItems(7) = Plan4.Range("h" & linha)
               Lista.SubItems(8) = Plan4.Range("i" & linha)
               Lista.SubItems(9) = Plan4.Range("j" & linha)
               Lista.SubItems(10) = Plan4.Range("k" & linha)
               Lista.SubItems(11) = Plan4.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

Dim am As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     am = 2
  
    Dim ao As Integer
  
     ao = 2
    

    If Me.ComboBox1 = "LI-L08-MERCAD" Then              ''CONTAGEM DIVISÃO DE MACRO 05
  
  
    Do While Plan58.Range("ak" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ak" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("am" & am) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("am" & am)
    am = am + 1
    Loop
  
  
    Do While Plan58.Range("ao" & ao) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ao" & ao)
    ao = ao + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan25.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan25.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan25.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan25.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan25.Range("d" & linha)
               Lista.SubItems(4) = Plan25.Range("e" & linha)
               Lista.SubItems(5) = Plan25.Range("f" & linha)
               Lista.SubItems(6) = Plan25.Range("g" & linha)
               Lista.SubItems(7) = Plan25.Range("h" & linha)
               Lista.SubItems(8) = Plan25.Range("i" & linha)
               Lista.SubItems(9) = Plan25.Range("j" & linha)
               Lista.SubItems(10) = Plan25.Range("k" & linha)
               Lista.SubItems(11) = Plan25.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

Dim at As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     at = 2
  
    Dim av As Integer
  
     av = 2
    

    If Me.ComboBox1 = "LI-L10-ITINGA" Then              ''CONTAGEM DIVISÃO DE MACRO 06
  
  
    Do While Plan58.Range("ar" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ar" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("at" & at) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("at" & at)
    at = at + 1
    Loop
  
  
    Do While Plan58.Range("av" & av) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("av" & av)
    av = av + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan26.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan26.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan26.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan26.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan26.Range("d" & linha)
               Lista.SubItems(4) = Plan26.Range("e" & linha)
               Lista.SubItems(5) = Plan26.Range("f" & linha)
               Lista.SubItems(6) = Plan26.Range("g" & linha)
               Lista.SubItems(7) = Plan26.Range("h" & linha)
               Lista.SubItems(8) = Plan26.Range("i" & linha)
               Lista.SubItems(9) = Plan26.Range("j" & linha)
               Lista.SubItems(10) = Plan26.Range("k" & linha)
               Lista.SubItems(11) = Plan26.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

Dim be As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     be = 2
  
    Dim bg As Integer
  
     bg = 2
    

    If Me.ComboBox1 = "LI-L11-PARAGO" Then              ''CONTAGEM DIVISÃO DE MACRO 07
  
  
    Do While Plan58.Range("bc" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("bc" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("be" & be) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("be" & be)
    be = be + 1
    Loop
  
  
    Do While Plan58.Range("bg" & bg) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("bg" & bg)
    bg = bg + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan27.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan27.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan27.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan27.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan27.Range("d" & linha)
               Lista.SubItems(4) = Plan27.Range("e" & linha)
               Lista.SubItems(5) = Plan27.Range("f" & linha)
               Lista.SubItems(6) = Plan27.Range("g" & linha)
               Lista.SubItems(7) = Plan27.Range("h" & linha)
               Lista.SubItems(8) = Plan27.Range("i" & linha)
               Lista.SubItems(9) = Plan27.Range("j" & linha)
               Lista.SubItems(10) = Plan27.Range("k" & linha)
               Lista.SubItems(11) = Plan27.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

    Dim bl As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     bl = 2
  
    Dim bn As Integer
  
     bn = 2
    

    If Me.ComboBox1 = "LI-L13-BALSAS" Then              ''CONTAGEM DIVISÃO DE MACRO 08
  
  
    Do While Plan58.Range("bj" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("bj" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("bl" & bl) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("bl" & bl)
    bl = bl + 1
    Loop
  
  
    Do While Plan58.Range("bn" & bn) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("bn" & bn)
    bn = bn + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan28.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan28.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan28.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan28.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan28.Range("d" & linha)
               Lista.SubItems(4) = Plan28.Range("e" & linha)
               Lista.SubItems(5) = Plan28.Range("f" & linha)
               Lista.SubItems(6) = Plan28.Range("g" & linha)
               Lista.SubItems(7) = Plan28.Range("h" & linha)
               Lista.SubItems(8) = Plan28.Range("i" & linha)
               Lista.SubItems(9) = Plan28.Range("j" & linha)
               Lista.SubItems(10) = Plan28.Range("k" & linha)
               Lista.SubItems(11) = Plan28.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

    Dim bs As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     bs = 2
  
    Dim bu As Integer
  
     bu = 2
    

    If Me.ComboBox1 = "LI-L15-S.ANTO" Then              ''CONTAGEM DIVISÃO DE MACRO 09
  
  
    Do While Plan58.Range("bq" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("bq" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("bs" & bs) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("bs" & bs)
    bs = bs + 1
    Loop
  
  
    Do While Plan58.Range("bu" & bu) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("bu" & bu)
    bu = bu + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan29.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan29.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan29.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan29.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan29.Range("d" & linha)
               Lista.SubItems(4) = Plan29.Range("e" & linha)
               Lista.SubItems(5) = Plan29.Range("f" & linha)
               Lista.SubItems(6) = Plan29.Range("g" & linha)
               Lista.SubItems(7) = Plan29.Range("h" & linha)
               Lista.SubItems(8) = Plan29.Range("i" & linha)
               Lista.SubItems(9) = Plan29.Range("j" & linha)
               Lista.SubItems(10) = Plan29.Range("k" & linha)
               Lista.SubItems(11) = Plan29.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

    Dim bz As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     bz = 2
  
    Dim cb As Integer
  
     cb = 2
    

    If Me.ComboBox1 = "LI-L17-SH.IMP" Then              ''CONTAGEM DIVISÃO DE MACRO 10
  
  
    Do While Plan58.Range("bx" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("bx" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("bz" & bz) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("bz" & bz)
    bz = bz + 1
    Loop
  
  
    Do While Plan58.Range("cb" & cb) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("cb" & cb)
    cb = cb + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan5.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan5.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan5.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan5.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan5.Range("d" & linha)
               Lista.SubItems(4) = Plan5.Range("e" & linha)
               Lista.SubItems(5) = Plan5.Range("f" & linha)
               Lista.SubItems(6) = Plan5.Range("g" & linha)
               Lista.SubItems(7) = Plan5.Range("h" & linha)
               Lista.SubItems(8) = Plan5.Range("i" & linha)
               Lista.SubItems(9) = Plan5.Range("j" & linha)
               Lista.SubItems(10) = Plan5.Range("k" & linha)
               Lista.SubItems(11) = Plan5.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

    Dim cg As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     cg = 2
  
    Dim ci As Integer
  
     ci = 2
    

    If Me.ComboBox1 = "LI-L18-S.FRAN" Then                  ''CONTAGEM DIVISÃO DE MACRO 11
  
  
    Do While Plan58.Range("ce" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ce" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("cg" & cg) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("cg" & cg)
    cg = cg + 1
    Loop
  
  
    Do While Plan58.Range("ci" & ci) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ci" & ci)
    ci = ci + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan30.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan30.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan30.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan30.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan30.Range("d" & linha)
               Lista.SubItems(4) = Plan30.Range("e" & linha)
               Lista.SubItems(5) = Plan30.Range("f" & linha)
               Lista.SubItems(6) = Plan30.Range("g" & linha)
               Lista.SubItems(7) = Plan30.Range("h" & linha)
               Lista.SubItems(8) = Plan30.Range("i" & linha)
               Lista.SubItems(9) = Plan30.Range("j" & linha)
               Lista.SubItems(10) = Plan30.Range("k" & linha)
               Lista.SubItems(11) = Plan30.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

Dim cn As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     cn = 2
  
    Dim cp As Integer
  
     cp = 2
    

    If Me.ComboBox1 = "LI-L19-COHAB" Then                   ''CONTAGEM DIVISÃO DE MACRO 12
  
  
    Do While Plan58.Range("cl" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("cl" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("cn" & cn) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("cn" & cn)
    cn = cn + 1
    Loop
  
  
    Do While Plan58.Range("cp" & cp) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("cp" & cp)
    cp = cp + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan31.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan31.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan31.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan31.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan31.Range("d" & linha)
               Lista.SubItems(4) = Plan31.Range("e" & linha)
               Lista.SubItems(5) = Plan31.Range("f" & linha)
               Lista.SubItems(6) = Plan31.Range("g" & linha)
               Lista.SubItems(7) = Plan31.Range("h" & linha)
               Lista.SubItems(8) = Plan31.Range("i" & linha)
               Lista.SubItems(9) = Plan31.Range("j" & linha)
               Lista.SubItems(10) = Plan31.Range("k" & linha)
               Lista.SubItems(11) = Plan31.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

Dim cw As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     cw = 2
  
    Dim cu As Integer
  
     cu = 2
    

    If Me.ComboBox1 = "LI-L21-ARAGUA" Then                  ''CONTAGEM DIVISÃO DE MACRO 13
  
  
    Do While Plan58.Range("cs" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("cs" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("cw" & cw) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("cw" & cw)
    cw = cw + 1
    Loop
  
  
    Do While Plan58.Range("cu" & cu) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("cu" & cu)
    cu = cu + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan6.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan6.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan6.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan6.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan6.Range("d" & linha)
               Lista.SubItems(4) = Plan6.Range("e" & linha)
               Lista.SubItems(5) = Plan6.Range("f" & linha)
               Lista.SubItems(6) = Plan6.Range("g" & linha)
               Lista.SubItems(7) = Plan6.Range("h" & linha)
               Lista.SubItems(8) = Plan6.Range("i" & linha)
               Lista.SubItems(9) = Plan6.Range("j" & linha)
               Lista.SubItems(10) = Plan6.Range("k" & linha)
               Lista.SubItems(11) = Plan6.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

Dim db As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     db = 2
  
    Dim dd As Integer
  
     dd = 2
    

    If Me.ComboBox1 = "LI-L23-MARABA" Then              ''CONTAGEM DIVISÃO DE MACRO 14
  
  
    Do While Plan58.Range("cz" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("cz" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("db" & db) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("db" & db)
    db = db + 1
    Loop
  
  
    Do While Plan58.Range("dd" & dd) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("dd" & dd)
    dd = dd + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan32.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan32.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan32.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan32.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan32.Range("d" & linha)
               Lista.SubItems(4) = Plan32.Range("e" & linha)
               Lista.SubItems(5) = Plan32.Range("f" & linha)
               Lista.SubItems(6) = Plan32.Range("g" & linha)
               Lista.SubItems(7) = Plan32.Range("h" & linha)
               Lista.SubItems(8) = Plan32.Range("i" & linha)
               Lista.SubItems(9) = Plan32.Range("j" & linha)
               Lista.SubItems(10) = Plan32.Range("k" & linha)
               Lista.SubItems(11) = Plan32.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

    Dim di As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     di = 2
  
    Dim dk As Integer
  
     dk = 2
    

    If Me.ComboBox1 = "LI-L24-CATANH" Then              ''CONTAGEM DIVISÃO DE MACRO 15
  
  
    Do While Plan58.Range("dg" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("dg" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("di" & di) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("di" & di)
    di = di + 1
    Loop
  
  
    Do While Plan58.Range("dk" & dk) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("dk" & dk)
    dk = dk + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan7.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan7.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan7.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan7.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan7.Range("d" & linha)
               Lista.SubItems(4) = Plan7.Range("e" & linha)
               Lista.SubItems(5) = Plan7.Range("f" & linha)
               Lista.SubItems(6) = Plan7.Range("g" & linha)
               Lista.SubItems(7) = Plan7.Range("h" & linha)
               Lista.SubItems(8) = Plan7.Range("i" & linha)
               Lista.SubItems(9) = Plan7.Range("j" & linha)
               Lista.SubItems(10) = Plan7.Range("k" & linha)
               Lista.SubItems(11) = Plan7.Range("l" & linha)


               
linha = linha + 1
Loop
 
End If

    Dim dp As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     dp = 2
  
    Dim dr As Integer
  
     dr = 2
    

    If Me.ComboBox1 = "LI-L25-MBARAT" Then              ''CONTAGEM DIVISÃO DE MACRO 16
  
  
    Do While Plan58.Range("dn" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("dn" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("dp" & dp) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("dp" & dp)
    dp = dp + 1
    Loop
  
  
    Do While Plan58.Range("dr" & dr) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("dr" & dr)
    dr = dr + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan8.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan8.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan8.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan8.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan8.Range("d" & linha)
               Lista.SubItems(4) = Plan8.Range("e" & linha)
               Lista.SubItems(5) = Plan8.Range("f" & linha)
               Lista.SubItems(6) = Plan8.Range("g" & linha)
               Lista.SubItems(7) = Plan8.Range("h" & linha)
               Lista.SubItems(8) = Plan8.Range("i" & linha)
               Lista.SubItems(9) = Plan8.Range("j" & linha)
               Lista.SubItems(10) = Plan8.Range("k" & linha)
               Lista.SubItems(11) = Plan8.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim dw As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     dw = 2
  
    Dim dy As Integer
  
     dy = 2
    

    If Me.ComboBox1 = "LI-L27-AÇAILA" Then              ''CONTAGEM DIVISÃO DE MACRO 17
  
  
    Do While Plan58.Range("du" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("du" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("dw" & dw) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("dw" & dw)
    dw = dw + 1
    Loop
  
  
    Do While Plan58.Range("dy" & dy) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("dy" & dy)
    dy = dy + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan33.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan33.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan33.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan33.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan33.Range("d" & linha)
               Lista.SubItems(4) = Plan33.Range("e" & linha)
               Lista.SubItems(5) = Plan33.Range("f" & linha)
               Lista.SubItems(6) = Plan33.Range("g" & linha)
               Lista.SubItems(7) = Plan33.Range("h" & linha)
               Lista.SubItems(8) = Plan33.Range("i" & linha)
               Lista.SubItems(9) = Plan33.Range("j" & linha)
               Lista.SubItems(10) = Plan33.Range("k" & linha)
               Lista.SubItems(11) = Plan33.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ed As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ed = 2
  
    Dim ef As Integer
  
     ef = 2
    

    If Me.ComboBox1 = "LI-L28-O.CRUZ" Then              ''CONTAGEM DIVISÃO DE MACRO 18
  
  
    Do While Plan58.Range("eb" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("eb" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ed" & ed) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ed" & ed)
    ed = ed + 1
    Loop
  
  
    Do While Plan58.Range("ef" & ef) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ef" & ef)
    ef = ef + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan34.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan34.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan34.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan34.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan34.Range("d" & linha)
               Lista.SubItems(4) = Plan34.Range("e" & linha)
               Lista.SubItems(5) = Plan34.Range("f" & linha)
               Lista.SubItems(6) = Plan34.Range("g" & linha)
               Lista.SubItems(7) = Plan34.Range("h" & linha)
               Lista.SubItems(8) = Plan34.Range("i" & linha)
               Lista.SubItems(9) = Plan34.Range("j" & linha)
               Lista.SubItems(10) = Plan34.Range("k" & linha)
               Lista.SubItems(11) = Plan34.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ek As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ek = 2
  
    Dim em As Integer
  
     em = 2
    

    If Me.ComboBox1 = "LI-L31-MBARAT" Then              ''CONTAGEM DIVISÃO DE MACRO 19
  
  
    Do While Plan58.Range("ei" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ei" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ek" & ek) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ek" & ek)
    ek = ek + 1
    Loop
  
  
    Do While Plan58.Range("em" & em) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("em" & em)
    em = em + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan35.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan35.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan35.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan35.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan35.Range("d" & linha)
               Lista.SubItems(4) = Plan35.Range("e" & linha)
               Lista.SubItems(5) = Plan35.Range("f" & linha)
               Lista.SubItems(6) = Plan35.Range("g" & linha)
               Lista.SubItems(7) = Plan35.Range("h" & linha)
               Lista.SubItems(8) = Plan35.Range("i" & linha)
               Lista.SubItems(9) = Plan35.Range("j" & linha)
               Lista.SubItems(10) = Plan35.Range("k" & linha)
               Lista.SubItems(11) = Plan35.Range("l" & linha)

linha = linha + 1

Loop
 
End If
Vai continuar...

Jairo2010

24-08-2012 00:16:21

2º Parte...

Código: Selecionar todos

Dim er As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     er = 2
  
    Dim et As Integer
  
     et = 2
    

    If Me.ComboBox1 = "LI-L32-S.POMP" Then              ''CONTAGEM DIVISÃO DE MACRO 20
  
  
    Do While Plan58.Range("ep" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ep" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("er" & er) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("er" & er)
    er = er + 1
    Loop
  
  
    Do While Plan58.Range("et" & et) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("et" & et)
    et = et + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan36.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan36.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan36.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan36.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan36.Range("d" & linha)
               Lista.SubItems(4) = Plan36.Range("e" & linha)
               Lista.SubItems(5) = Plan36.Range("f" & linha)
               Lista.SubItems(6) = Plan36.Range("g" & linha)
               Lista.SubItems(7) = Plan36.Range("h" & linha)
               Lista.SubItems(8) = Plan36.Range("i" & linha)
               Lista.SubItems(9) = Plan36.Range("j" & linha)
               Lista.SubItems(10) = Plan36.Range("k" & linha)
               Lista.SubItems(11) = Plan36.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ey As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ey = 2
  
    Dim fa As Integer
  
     fa = 2
    

    If Me.ComboBox1 = "LI-L33-B.RBCO" Then          ''CONTAGEM DIVISÃO DE MACRO 21
  
  
    Do While Plan58.Range("ew" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ew" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ey" & ey) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ey" & ey)
    ey = ey + 1
    Loop
  
  
    Do While Plan58.Range("fa" & fa) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("fa" & fa)
    fa = fa + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan37.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan37.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan37.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan37.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan37.Range("d" & linha)
               Lista.SubItems(4) = Plan37.Range("e" & linha)
               Lista.SubItems(5) = Plan37.Range("f" & linha)
               Lista.SubItems(6) = Plan37.Range("g" & linha)
               Lista.SubItems(7) = Plan37.Range("h" & linha)
               Lista.SubItems(8) = Plan37.Range("i" & linha)
               Lista.SubItems(9) = Plan37.Range("j" & linha)
               Lista.SubItems(10) = Plan37.Range("k" & linha)
               Lista.SubItems(11) = Plan37.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim ff As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ff = 2
  
    Dim fh As Integer
  
     fh = 2
    

    If Me.ComboBox1 = "LI-L34-MESSEJ" Then              ''CONTAGEM DIVISÃO DE MACRO 22
  
  
    Do While Plan58.Range("ew" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ew" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ff" & ff) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ff" & ff)
    ff = ff + 1
    Loop
  
  
    Do While Plan58.Range("fh" & fh) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("fh" & fh)
    fh = fh + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan9.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan9.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan9.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan9.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan9.Range("d" & linha)
               Lista.SubItems(4) = Plan9.Range("e" & linha)
               Lista.SubItems(5) = Plan9.Range("f" & linha)
               Lista.SubItems(6) = Plan9.Range("g" & linha)
               Lista.SubItems(7) = Plan9.Range("h" & linha)
               Lista.SubItems(8) = Plan9.Range("i" & linha)
               Lista.SubItems(9) = Plan9.Range("j" & linha)
               Lista.SubItems(10) = Plan9.Range("k" & linha)
               Lista.SubItems(11) = Plan9.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim fm As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     fm = 2
  
    Dim fo As Integer
  
     fo = 2
    
    
    If Me.ComboBox1 = "LI-L35-S.POMP" Then              ''CONTAGEM DIVISÃO DE MACRO 23
  
  
    Do While Plan58.Range("fk" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("fk" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("fm" & fm) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("fm" & fm)
    fm = fm + 1
    Loop
  
  
    Do While Plan58.Range("fo" & fo) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("fo" & fo)
    fo = fo + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan38.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan38.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan38.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan38.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan38.Range("d" & linha)
               Lista.SubItems(4) = Plan38.Range("e" & linha)
               Lista.SubItems(5) = Plan38.Range("f" & linha)
               Lista.SubItems(6) = Plan38.Range("g" & linha)
               Lista.SubItems(7) = Plan38.Range("h" & linha)
               Lista.SubItems(8) = Plan38.Range("i" & linha)
               Lista.SubItems(9) = Plan38.Range("j" & linha)
               Lista.SubItems(10) = Plan38.Range("k" & linha)
               Lista.SubItems(11) = Plan38.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ft As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ft = 2
  
    Dim fv As Integer
  
     fv = 2
    

    If Me.ComboBox1 = "LI-L36-JUAZEI" Then              ''CONTAGEM DIVISÃO DE MACRO 24
  
  
    Do While Plan58.Range("fr" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("fr" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ft" & ft) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ft" & ft)
    ft = ft + 1
    Loop
  
  
    Do While Plan58.Range("fv" & fv) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("fv" & fv)
    fv = fv + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan39.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan39.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan39.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan39.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan39.Range("d" & linha)
               Lista.SubItems(4) = Plan39.Range("e" & linha)
               Lista.SubItems(5) = Plan39.Range("f" & linha)
               Lista.SubItems(6) = Plan39.Range("g" & linha)
               Lista.SubItems(7) = Plan39.Range("h" & linha)
               Lista.SubItems(8) = Plan39.Range("i" & linha)
               Lista.SubItems(9) = Plan39.Range("j" & linha)
               Lista.SubItems(10) = Plan39.Range("k" & linha)
               Lista.SubItems(11) = Plan39.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim ga As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ga = 2
  
    Dim gc As Integer
  
     gc = 2
    

    If Me.ComboBox1 = "LI-L37-TERESI" Then          ''CONTAGEM DIVISÃO DE MACRO 25
  
  
    Do While Plan58.Range("fy" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("fy" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ga" & ga) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ga" & ga)
    ga = ga + 1
    Loop
  
  
    Do While Plan58.Range("gc" & gc) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("gc" & gc)
    gc = gc + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan10.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan10.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan10.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan10.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan10.Range("d" & linha)
               Lista.SubItems(4) = Plan10.Range("e" & linha)
               Lista.SubItems(5) = Plan10.Range("f" & linha)
               Lista.SubItems(6) = Plan10.Range("g" & linha)
               Lista.SubItems(7) = Plan10.Range("h" & linha)
               Lista.SubItems(8) = Plan10.Range("i" & linha)
               Lista.SubItems(9) = Plan10.Range("j" & linha)
               Lista.SubItems(10) = Plan10.Range("k" & linha)
               Lista.SubItems(11) = Plan10.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim gh As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     gh = 2
  
    Dim gj As Integer
  
     gj = 2
    

    If Me.ComboBox1 = "LI-L39-G.SAMP" Then              ''CONTAGEM DIVISÃO DE MACRO 26
  
  
    Do While Plan58.Range("gf" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("gf" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("gh" & gh) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("gh" & gh)
    gh = gh + 1
    Loop
  
  
    Do While Plan58.Range("gj" & gj) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("gj" & gj)
    gj = gj + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan40.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan40.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan40.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan40.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan40.Range("d" & linha)
               Lista.SubItems(4) = Plan40.Range("e" & linha)
               Lista.SubItems(5) = Plan40.Range("f" & linha)
               Lista.SubItems(6) = Plan40.Range("g" & linha)
               Lista.SubItems(7) = Plan40.Range("h" & linha)
               Lista.SubItems(8) = Plan40.Range("i" & linha)
               Lista.SubItems(9) = Plan40.Range("j" & linha)
               Lista.SubItems(10) = Plan40.Range("k" & linha)
               Lista.SubItems(11) = Plan40.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim go As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     go = 2
  
    Dim gq As Integer
  
     gq = 2
    

    If Me.ComboBox1 = "LI-L41-N.MARABA" Then                ''CONTAGEM DIVISÃO DE MACRO 27
  
  
    Do While Plan58.Range("gm" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("gm" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("go" & go) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("go" & go)
    go = go + 1
    Loop
  
  
    Do While Plan58.Range("gq" & gq) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("gq" & gq)
    gq = gq + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan41.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan41.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan41.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan41.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan41.Range("d" & linha)
               Lista.SubItems(4) = Plan41.Range("e" & linha)
               Lista.SubItems(5) = Plan41.Range("f" & linha)
               Lista.SubItems(6) = Plan41.Range("g" & linha)
               Lista.SubItems(7) = Plan41.Range("h" & linha)
               Lista.SubItems(8) = Plan41.Range("i" & linha)
               Lista.SubItems(9) = Plan41.Range("j" & linha)
               Lista.SubItems(10) = Plan41.Range("k" & linha)
               Lista.SubItems(11) = Plan41.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim gv As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     gv = 2
  
    Dim gx As Integer
  
     gx = 2
    

    If Me.ComboBox1 = "LI-L42-ANANIN" Then              ''CONTAGEM DIVISÃO DE MACRO 28
  
  
    Do While Plan58.Range("gt" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("gt" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("gv" & gv) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("gv" & gv)
    gv = gv + 1
    Loop
  
  
    Do While Plan58.Range("gx" & gx) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("gx" & gx)
    gx = gx + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan42.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan42.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan42.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan42.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan42.Range("d" & linha)
               Lista.SubItems(4) = Plan42.Range("e" & linha)
               Lista.SubItems(5) = Plan42.Range("f" & linha)
               Lista.SubItems(6) = Plan42.Range("g" & linha)
               Lista.SubItems(7) = Plan42.Range("h" & linha)
               Lista.SubItems(8) = Plan42.Range("i" & linha)
               Lista.SubItems(9) = Plan42.Range("j" & linha)
               Lista.SubItems(10) = Plan42.Range("k" & linha)
               Lista.SubItems(11) = Plan42.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim hc As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     hc = 2
  
    Dim he As Integer
  
     he = 2
    

    If Me.ComboBox1 = "LI-L46-PALMAS" Then                  ''CONTAGEM DIVISÃO DE MACRO 29
  
  
    Do While Plan58.Range("ha" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ha" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("hc" & hc) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("hc" & hc)
    hc = hc + 1
    Loop
  
  
    Do While Plan58.Range("he" & he) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("he" & he)
    he = he + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan11.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan11.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan11.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan11.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan11.Range("d" & linha)
               Lista.SubItems(4) = Plan11.Range("e" & linha)
               Lista.SubItems(5) = Plan11.Range("f" & linha)
               Lista.SubItems(6) = Plan11.Range("g" & linha)
               Lista.SubItems(7) = Plan11.Range("h" & linha)
               Lista.SubItems(8) = Plan11.Range("i" & linha)
               Lista.SubItems(9) = Plan11.Range("j" & linha)
               Lista.SubItems(10) = Plan11.Range("k" & linha)
               Lista.SubItems(11) = Plan11.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim hj As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     hj = 2
  
    Dim hl As Integer
  
     hl = 2
    

    If Me.ComboBox1 = "LI-L48-JPAULO" Then          ''CONTAGEM DIVISÃO DE MACRO 30
  
  
    Do While Plan58.Range("hh" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("hh" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("hj" & hj) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("hj" & hj)
    hj = hj + 1
    Loop
  
  
    Do While Plan58.Range("hl" & hl) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("hl" & hl)
    hl = hl + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan43.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan43.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan43.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan43.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan43.Range("d" & linha)
               Lista.SubItems(4) = Plan43.Range("e" & linha)
               Lista.SubItems(5) = Plan43.Range("f" & linha)
               Lista.SubItems(6) = Plan43.Range("g" & linha)
               Lista.SubItems(7) = Plan43.Range("h" & linha)
               Lista.SubItems(8) = Plan43.Range("i" & linha)
               Lista.SubItems(9) = Plan43.Range("j" & linha)
               Lista.SubItems(10) = Plan43.Range("k" & linha)
               Lista.SubItems(11) = Plan43.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim hq As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     hq = 2
  
    Dim hs As Integer
  
     hs = 2
    

    If Me.ComboBox1 = "LI-L49-S.INES" Then          ''CONTAGEM DIVISÃO DE MACRO 31
  
  
    Do While Plan58.Range("ho" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ho" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("hq" & hq) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("hq" & hq)
    hq = hq + 1
    Loop
  
  
    Do While Plan58.Range("hs" & hs) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("hs" & hs)
    hs = hs + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan44.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan44.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan44.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan44.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan44.Range("d" & linha)
               Lista.SubItems(4) = Plan44.Range("e" & linha)
               Lista.SubItems(5) = Plan44.Range("f" & linha)
               Lista.SubItems(6) = Plan44.Range("g" & linha)
               Lista.SubItems(7) = Plan44.Range("h" & linha)
               Lista.SubItems(8) = Plan44.Range("i" & linha)
               Lista.SubItems(9) = Plan44.Range("j" & linha)
               Lista.SubItems(10) = Plan44.Range("k" & linha)
               Lista.SubItems(11) = Plan44.Range("l" & linha)

linha = linha + 1

Loop
 
    End If

    Dim hx As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     hx = 2
  
    Dim hz As Integer
  
     hz = 2
    

    If Me.ComboBox1 = "LI-L51-SOBRAL" Then          ''CONTAGEM DIVISÃO DE MACRO 32
  
  
    Do While Plan58.Range("hv" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("hv" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("hx" & hx) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("hx" & hx)
    hx = hx + 1
    Loop
  
  
    Do While Plan58.Range("hz" & hz) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("hz" & hz)
    hz = hz + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan45.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan45.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan45.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan45.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan45.Range("d" & linha)
               Lista.SubItems(4) = Plan45.Range("e" & linha)
               Lista.SubItems(5) = Plan45.Range("f" & linha)
               Lista.SubItems(6) = Plan45.Range("g" & linha)
               Lista.SubItems(7) = Plan45.Range("h" & linha)
               Lista.SubItems(8) = Plan45.Range("i" & linha)
               Lista.SubItems(9) = Plan45.Range("j" & linha)
               Lista.SubItems(10) = Plan45.Range("k" & linha)
               Lista.SubItems(11) = Plan45.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim ie As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ie = 2
  
    Dim ig As Integer
  
     ig = 2
    

    If Me.ComboBox1 = "LI-L52-REDENC" Then          ''CONTAGEM DIVISÃO DE MACRO 33
  
  
    Do While Plan58.Range("ic" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ic" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ie" & ie) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ie" & ie)
    ie = ie + 1
    Loop
  
  
    Do While Plan58.Range("ig" & ig) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ig" & ig)
    ig = ig + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan46.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan46.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan46.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan46.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan46.Range("d" & linha)
               Lista.SubItems(4) = Plan46.Range("e" & linha)
               Lista.SubItems(5) = Plan46.Range("f" & linha)
               Lista.SubItems(6) = Plan46.Range("g" & linha)
               Lista.SubItems(7) = Plan46.Range("h" & linha)
               Lista.SubItems(8) = Plan46.Range("i" & linha)
               Lista.SubItems(9) = Plan46.Range("j" & linha)
               Lista.SubItems(10) = Plan46.Range("k" & linha)
               Lista.SubItems(11) = Plan46.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim il As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     il = 2
  
    Dim io As Integer
  
     io = 2
    

    If Me.ComboBox1 = "LI-L53-PARAUA" Then          ''CONTAGEM DIVISÃO DE MACRO 34
  
  
    Do While Plan58.Range("ij" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ij" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("il" & il) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("il" & il)
    il = il + 1
    Loop
  
  
    Do While Plan58.Range("io" & io) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("io" & io)
    io = io + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan12.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan12.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan12.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan12.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan12.Range("d" & linha)
               Lista.SubItems(4) = Plan12.Range("e" & linha)
               Lista.SubItems(5) = Plan12.Range("f" & linha)
               Lista.SubItems(6) = Plan12.Range("g" & linha)
               Lista.SubItems(7) = Plan12.Range("h" & linha)
               Lista.SubItems(8) = Plan12.Range("i" & linha)
               Lista.SubItems(9) = Plan12.Range("j" & linha)
               Lista.SubItems(10) = Plan12.Range("k" & linha)
               Lista.SubItems(11) = Plan12.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    'Dim is As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
    'iu = 2
  
    Dim iu As Integer
  
     iu = 2
    

    If Me.ComboBox1 = "LI-L56-ESTREI" Then          ''CONTAGEM DIVISÃO DE MACRO 35
  
  
    Do While Plan58.Range("iq" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("iq" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("iu" & iu) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("iu" & iu)
    iu = iu + 1
    Loop
  
  
    Do While Plan58.Range("iu" & iu) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("iu" & iu)
    iu = iu + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan47.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan47.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan47.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan47.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan47.Range("d" & linha)
               Lista.SubItems(4) = Plan47.Range("e" & linha)
               Lista.SubItems(5) = Plan47.Range("f" & linha)
               Lista.SubItems(6) = Plan47.Range("g" & linha)
               Lista.SubItems(7) = Plan47.Range("h" & linha)
               Lista.SubItems(8) = Plan47.Range("i" & linha)
               Lista.SubItems(9) = Plan47.Range("j" & linha)
               Lista.SubItems(10) = Plan47.Range("k" & linha)
               Lista.SubItems(11) = Plan47.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim iz As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     iz = 2
  
    Dim jb As Integer
  
     jb = 2
    

    If Me.ComboBox1 = "LI-L57-CIDOPE" Then          ''CONTAGEM DIVISÃO DE MACRO 36
  
  
    Do While Plan58.Range("ix" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ix" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("iz" & iz) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("iz" & iz)
    iz = iz + 1
    Loop
  
  
    Do While Plan58.Range("jb" & jb) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("jb" & jb)
    jb = jb + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan48.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan48.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan48.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan48.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan48.Range("d" & linha)
               Lista.SubItems(4) = Plan48.Range("e" & linha)
               Lista.SubItems(5) = Plan48.Range("f" & linha)
               Lista.SubItems(6) = Plan48.Range("g" & linha)
               Lista.SubItems(7) = Plan48.Range("h" & linha)
               Lista.SubItems(8) = Plan48.Range("i" & linha)
               Lista.SubItems(9) = Plan48.Range("j" & linha)
               Lista.SubItems(10) = Plan48.Range("k" & linha)
               Lista.SubItems(11) = Plan48.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim jg As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     jg = 2
  
    Dim ji As Integer
  
     ji = 2
    

    If Me.ComboBox1 = "LI-L58-PEDREI" Then      ''CONTAGEM DIVISÃO DE MACRO 37
  
  
    Do While Plan58.Range("je" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("je" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("jg" & jg) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("jg" & jg)
    jg = jg + 1
    Loop
  
  
    Do While Plan58.Range("ji" & ji) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ji" & ji)
    ji = ji + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan13.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan13.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan13.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan13.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan13.Range("d" & linha)
               Lista.SubItems(4) = Plan13.Range("e" & linha)
               Lista.SubItems(5) = Plan13.Range("f" & linha)
               Lista.SubItems(6) = Plan13.Range("g" & linha)
               Lista.SubItems(7) = Plan13.Range("h" & linha)
               Lista.SubItems(8) = Plan13.Range("i" & linha)
               Lista.SubItems(9) = Plan13.Range("j" & linha)
               Lista.SubItems(10) = Plan13.Range("k" & linha)
               Lista.SubItems(11) = Plan13.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim jn As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     jn = 2
  
    Dim jp As Integer
  
     jp = 2
    

    If Me.ComboBox1 = "LI-L59-MAIOBA" Then      ''CONTAGEM DIVISÃO DE MACRO 38
  
  
    Do While Plan58.Range("jl" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("jl" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("jn" & jn) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("jn" & jn)
    jn = jn + 1
    Loop
  
  
    Do While Plan58.Range("jp" & jp) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("jp" & jp)
    jp = jp + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan14.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan14.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan14.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan14.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan14.Range("d" & linha)
               Lista.SubItems(4) = Plan14.Range("e" & linha)
               Lista.SubItems(5) = Plan14.Range("f" & linha)
               Lista.SubItems(6) = Plan14.Range("g" & linha)
               Lista.SubItems(7) = Plan14.Range("h" & linha)
               Lista.SubItems(8) = Plan14.Range("i" & linha)
               Lista.SubItems(9) = Plan14.Range("j" & linha)
               Lista.SubItems(10) = Plan14.Range("k" & linha)
               Lista.SubItems(11) = Plan14.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ju As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ju = 2
  
    Dim jw As Integer
  
     jw = 2
    

    If Me.ComboBox1 = "LI-L61-N.IMP" Then               ''CONTAGEM DIVISÃO DE MACRO 39
  
  
    Do While Plan58.Range("js" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("js" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ju" & ju) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ju" & ju)
    ju = ju + 1
    Loop
  
  
    Do While Plan58.Range("jw" & jw) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("jw" & jw)
    jw = jw + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan15.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan15.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan15.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan15.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan15.Range("d" & linha)
               Lista.SubItems(4) = Plan15.Range("e" & linha)
               Lista.SubItems(5) = Plan15.Range("f" & linha)
               Lista.SubItems(6) = Plan15.Range("g" & linha)
               Lista.SubItems(7) = Plan15.Range("h" & linha)
               Lista.SubItems(8) = Plan15.Range("i" & linha)
               Lista.SubItems(9) = Plan15.Range("j" & linha)
               Lista.SubItems(10) = Plan15.Range("k" & linha)
               Lista.SubItems(11) = Plan15.Range("l" & linha)

linha = linha + 1

Loop
 
End If
E ainda tem a terceira parte.

Jairo2010

24-08-2012 00:17:36

3º Parte e última.

Código: Selecionar todos

 Dim kb As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     kb = 2
  
    Dim kd As Integer
  
     kd = 2
    

    If Me.ComboBox1 = "LI-L62-TIMON" Then               ''CONTAGEM DIVISÃO DE MACRO 40
  
  
    Do While Plan58.Range("jz" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("jz" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("kb" & kb) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("kb" & kb)
    kb = kb + 1
    Loop
  
  
    Do While Plan58.Range("kd" & kd) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("kd" & kd)
    kd = kd + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan49.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan49.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan49.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan49.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan49.Range("d" & linha)
               Lista.SubItems(4) = Plan49.Range("e" & linha)
               Lista.SubItems(5) = Plan49.Range("f" & linha)
               Lista.SubItems(6) = Plan49.Range("g" & linha)
               Lista.SubItems(7) = Plan49.Range("h" & linha)
               Lista.SubItems(8) = Plan49.Range("i" & linha)
               Lista.SubItems(9) = Plan49.Range("j" & linha)
               Lista.SubItems(10) = Plan49.Range("k" & linha)
               Lista.SubItems(11) = Plan49.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ki As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ki = 2
  
    Dim kk As Integer
  
     kk = 2
    

    If Me.ComboBox1 = "LI-L63-S.MAT" Then           ''CONTAGEM DIVISÃO DE MACRO 41
  
  
    Do While Plan58.Range("kg" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("kg" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ki" & ki) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ki" & ki)
    ki = ki + 1
    Loop
  
  
    Do While Plan58.Range("kk" & kk) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("kk" & kk)
    kk = kk + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan16.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan16.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan16.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan16.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan16.Range("d" & linha)
               Lista.SubItems(4) = Plan16.Range("e" & linha)
               Lista.SubItems(5) = Plan16.Range("f" & linha)
               Lista.SubItems(6) = Plan16.Range("g" & linha)
               Lista.SubItems(7) = Plan16.Range("h" & linha)
               Lista.SubItems(8) = Plan16.Range("i" & linha)
               Lista.SubItems(9) = Plan16.Range("j" & linha)
               Lista.SubItems(10) = Plan16.Range("k" & linha)
               Lista.SubItems(11) = Plan16.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim kp As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     kp = 2
  
    Dim kr As Integer
  
     kr = 2
    

    If Me.ComboBox1 = "LI-L66-ICOARA" Then              ''CONTAGEM DIVISÃO DE MACRO 42
  
  
    Do While Plan58.Range("kn" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("kn" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("kp" & kp) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("kp" & kp)
    kp = kp + 1
    Loop
  
  
    Do While Plan58.Range("kr" & kr) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("kr" & kr)
    kr = kr + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan50.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan50.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan50.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan50.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan50.Range("d" & linha)
               Lista.SubItems(4) = Plan50.Range("e" & linha)
               Lista.SubItems(5) = Plan50.Range("f" & linha)
               Lista.SubItems(6) = Plan50.Range("g" & linha)
               Lista.SubItems(7) = Plan50.Range("h" & linha)
               Lista.SubItems(8) = Plan50.Range("i" & linha)
               Lista.SubItems(9) = Plan50.Range("j" & linha)
               Lista.SubItems(10) = Plan50.Range("k" & linha)
               Lista.SubItems(11) = Plan50.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim kw As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     kw = 2
  
    Dim ky As Integer
  
     ky = 2
    

    If Me.ComboBox1 = "LI-L31-MBARAT" Then          ''CONTAGEM DIVISÃO DE MACRO 43
  
  
    Do While Plan58.Range("ku" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("ku" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("kw" & kw) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("kw" & kw)
    kw = kw + 1
    Loop
  
  
    Do While Plan58.Range("ky" & ky) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ky" & ky)
    ky = ky + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan51.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan51.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan51.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan51.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan51.Range("d" & linha)
               Lista.SubItems(4) = Plan51.Range("e" & linha)
               Lista.SubItems(5) = Plan51.Range("f" & linha)
               Lista.SubItems(6) = Plan51.Range("g" & linha)
               Lista.SubItems(7) = Plan51.Range("h" & linha)
               Lista.SubItems(8) = Plan51.Range("i" & linha)
               Lista.SubItems(9) = Plan51.Range("j" & linha)
               Lista.SubItems(10) = Plan51.Range("k" & linha)
               Lista.SubItems(11) = Plan51.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ld As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ld = 2
  
    Dim lg As Integer
  
     lg = 2
    

    If Me.ComboBox1 = "LI-L69-CAXIAS" Then              ''CONTAGEM DIVISÃO DE MACRO 44
  
  
    Do While Plan58.Range("lb" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("lb" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ld" & ld) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ld" & ld)
    ld = ld + 1
    Loop
  
  
    Do While Plan58.Range("lg" & lg) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("lg" & lg)
    lg = lg + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan52.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan52.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan52.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan52.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan52.Range("d" & linha)
               Lista.SubItems(4) = Plan52.Range("e" & linha)
               Lista.SubItems(5) = Plan52.Range("f" & linha)
               Lista.SubItems(6) = Plan52.Range("g" & linha)
               Lista.SubItems(7) = Plan52.Range("h" & linha)
               Lista.SubItems(8) = Plan52.Range("i" & linha)
               Lista.SubItems(9) = Plan52.Range("j" & linha)
               Lista.SubItems(10) = Plan52.Range("k" & linha)
               Lista.SubItems(11) = Plan52.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim lk As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     lk = 2
  
    Dim lm As Integer
  
     lm = 2
    

    If Me.ComboBox1 = "LI-L70-PARAIS" Then              ''CONTAGEM DIVISÃO DE MACRO 45
  
  
    Do While Plan58.Range("li" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("li" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("lk" & lk) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("lk" & lk)
    lk = lk + 1
    Loop
  
  
    Do While Plan58.Range("lm" & lm) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("lm" & lm)
    lm = lm + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan53.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan53.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan53.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan53.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan53.Range("d" & linha)
               Lista.SubItems(4) = Plan53.Range("e" & linha)
               Lista.SubItems(5) = Plan53.Range("f" & linha)
               Lista.SubItems(6) = Plan53.Range("g" & linha)
               Lista.SubItems(7) = Plan53.Range("h" & linha)
               Lista.SubItems(8) = Plan53.Range("i" & linha)
               Lista.SubItems(9) = Plan53.Range("j" & linha)
               Lista.SubItems(10) = Plan53.Range("k" & linha)
               Lista.SubItems(11) = Plan53.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim lr As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     lr = 2
  
    Dim lt As Integer
  
     lt = 2
    

    If Me.ComboBox1 = "LI-L71-R.PAZ" Then           ''CONTAGEM DIVISÃO DE MACRO 46
  
  
    Do While Plan58.Range("lp" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("lp" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("lr" & lr) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("lr" & lr)
    lr = lr + 1
    Loop
  
  
    Do While Plan58.Range("lt" & lt) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("lt" & lt)
    lt = lt + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan54.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan54.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan54.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan54.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan54.Range("d" & linha)
               Lista.SubItems(4) = Plan54.Range("e" & linha)
               Lista.SubItems(5) = Plan54.Range("f" & linha)
               Lista.SubItems(6) = Plan54.Range("g" & linha)
               Lista.SubItems(7) = Plan54.Range("h" & linha)
               Lista.SubItems(8) = Plan54.Range("i" & linha)
               Lista.SubItems(9) = Plan54.Range("j" & linha)
               Lista.SubItems(10) = Plan54.Range("k" & linha)
               Lista.SubItems(11) = Plan54.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim ly As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     ly = 2
  
    Dim ma As Integer
  
     ma = 2
    

    If Me.ComboBox1 = "LI-L72-ZEDOCA" Then      ''CONTAGEM DIVISÃO DE MACRO 47
  
  
    Do While Plan58.Range("lw" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("lw" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("ly" & ly) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("ly" & ly)
    ly = ly + 1
    Loop
  
  
    Do While Plan58.Range("ma" & ma) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("ma" & ma)
    ma = ma + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan17.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan17.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan17.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan17.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan17.Range("d" & linha)
               Lista.SubItems(4) = Plan17.Range("e" & linha)
               Lista.SubItems(5) = Plan17.Range("f" & linha)
               Lista.SubItems(6) = Plan17.Range("g" & linha)
               Lista.SubItems(7) = Plan17.Range("h" & linha)
               Lista.SubItems(8) = Plan17.Range("i" & linha)
               Lista.SubItems(9) = Plan17.Range("j" & linha)
               Lista.SubItems(10) = Plan17.Range("k" & linha)
               Lista.SubItems(11) = Plan17.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim mf As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     mf = 2
  
    Dim mh As Integer
  
     mh = 2
    

    If Me.ComboBox1 = "LI-L73-MAIOBA" Then          ''CONTAGEM DIVISÃO DE MACRO 48
  
  
    Do While Plan58.Range("md" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("md" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("mf" & mf) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("mf" & mf)
    mf = mf + 1
    Loop
  
  
    Do While Plan58.Range("mh" & mh) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("mh" & mh)
    mh = mh + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan55.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan55.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan55.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan55.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan55.Range("d" & linha)
               Lista.SubItems(4) = Plan55.Range("e" & linha)
               Lista.SubItems(5) = Plan55.Range("f" & linha)
               Lista.SubItems(6) = Plan55.Range("g" & linha)
               Lista.SubItems(7) = Plan55.Range("h" & linha)
               Lista.SubItems(8) = Plan55.Range("i" & linha)
               Lista.SubItems(9) = Plan55.Range("j" & linha)
               Lista.SubItems(10) = Plan55.Range("k" & linha)
               Lista.SubItems(11) = Plan55.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Dim mm As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     mm = 2
  
    Dim mo As Integer
  
     mo = 2
    

    If Me.ComboBox1 = "LI-L74-PEDREI" Then              ''CONTAGEM DIVISÃO DE MACRO 49
  
  
    Do While Plan58.Range("mk" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("mk" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("mm" & mm) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("mm" & mm)
    mm = mm + 1
    Loop
  
  
    Do While Plan58.Range("mo" & mo) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("mo" & mo)
    mo = mo + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan56.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan56.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan56.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan56.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan56.Range("d" & linha)
               Lista.SubItems(4) = Plan56.Range("e" & linha)
               Lista.SubItems(5) = Plan56.Range("f" & linha)
               Lista.SubItems(6) = Plan56.Range("g" & linha)
               Lista.SubItems(7) = Plan56.Range("h" & linha)
               Lista.SubItems(8) = Plan56.Range("i" & linha)
               Lista.SubItems(9) = Plan56.Range("j" & linha)
               Lista.SubItems(10) = Plan56.Range("k" & linha)
               Lista.SubItems(11) = Plan56.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim mt As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     mt = 2
  
    Dim mv As Integer
  
     mv = 2
    

    If Me.ComboBox1 = "LI-L75-S.LEMO" Then          ''CONTAGEM DIVISÃO DE MACRO 50
  
  
    Do While Plan58.Range("mr" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("mr" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("mt" & mt) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("mt" & mt)
    mt = mt + 1
    Loop
  
  
    Do While Plan58.Range("mv" & mv) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("mv" & mv)
    mv = mv + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan57.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan57.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan57.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan57.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan57.Range("d" & linha)
               Lista.SubItems(4) = Plan57.Range("e" & linha)
               Lista.SubItems(5) = Plan57.Range("f" & linha)
               Lista.SubItems(6) = Plan57.Range("g" & linha)
               Lista.SubItems(7) = Plan57.Range("h" & linha)
               Lista.SubItems(8) = Plan57.Range("i" & linha)
               Lista.SubItems(9) = Plan57.Range("j" & linha)
               Lista.SubItems(10) = Plan57.Range("k" & linha)
               Lista.SubItems(11) = Plan57.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim na As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     na = 2
  
    Dim nc As Integer
  
     nc = 2
    

    If Me.ComboBox1 = "LI-L76-BCORDA" Then          ''CONTAGEM DIVISÃO DE MACRO 51
  
  
    Do While Plan58.Range("my" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("my" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("na" & na) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("na" & na)
    na = na + 1
    Loop
  
  
    Do While Plan58.Range("nc" & nc) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("nc" & nc)
    nc = nc + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan18.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan18.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan18.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan18.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan18.Range("d" & linha)
               Lista.SubItems(4) = Plan18.Range("e" & linha)
               Lista.SubItems(5) = Plan18.Range("f" & linha)
               Lista.SubItems(6) = Plan18.Range("g" & linha)
               Lista.SubItems(7) = Plan18.Range("h" & linha)
               Lista.SubItems(8) = Plan18.Range("i" & linha)
               Lista.SubItems(9) = Plan18.Range("j" & linha)
               Lista.SubItems(10) = Plan18.Range("k" & linha)
               Lista.SubItems(11) = Plan18.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim nh As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     nh = 2
  
    Dim nj As Integer
  
     nj = 2
    

    If Me.ComboBox1 = "LI-L80-ANGELI" Then              ''CONTAGEM DIVISÃO DE MACRO 52
  
  
    Do While Plan58.Range("nf" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("nf" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("nh" & nh) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("nh" & nh)
    nh = nh + 1
    Loop
  
  
    Do While Plan58.Range("nj" & nj) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("nj" & nj)
    nj = nj + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan19.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan19.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan19.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan19.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan19.Range("d" & linha)
               Lista.SubItems(4) = Plan19.Range("e" & linha)
               Lista.SubItems(5) = Plan19.Range("f" & linha)
               Lista.SubItems(6) = Plan19.Range("g" & linha)
               Lista.SubItems(7) = Plan19.Range("h" & linha)
               Lista.SubItems(8) = Plan19.Range("i" & linha)
               Lista.SubItems(9) = Plan19.Range("j" & linha)
               Lista.SubItems(10) = Plan19.Range("k" & linha)
               Lista.SubItems(11) = Plan19.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim no As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     no = 2
  
    Dim nq As Integer
  
     nq = 2
    

    If Me.ComboBox1 = "LC-MATRIZ" Then              ''CONTAGEM DIVISÃO DE MACRO 53
  
  
    Do While Plan58.Range("nm" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("nm" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("no" & no) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("no" & no)
    no = no + 1
    Loop
  
  
    Do While Plan58.Range("nq" & nq) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("nq" & nq)
    nq = nq + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan60.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan60.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan60.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan60.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan60.Range("d" & linha)
               Lista.SubItems(4) = Plan60.Range("e" & linha)
               Lista.SubItems(5) = Plan60.Range("f" & linha)
               Lista.SubItems(6) = Plan60.Range("g" & linha)
               Lista.SubItems(7) = Plan60.Range("h" & linha)
               Lista.SubItems(8) = Plan60.Range("i" & linha)
               Lista.SubItems(9) = Plan60.Range("j" & linha)
               Lista.SubItems(10) = Plan60.Range("k" & linha)
               Lista.SubItems(11) = Plan60.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim nt As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     nt = 2
  
    Dim nx As Integer
  
     nx = 2
    

    If Me.ComboBox1 = "LC-FL.04" Then               ''CONTAGEM DIVISÃO DE MACRO 54
  
  
    Do While Plan58.Range("nv" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("nv" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("nt" & nt) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("nt" & nt)
    nt = nt + 1
    Loop
  
  
    Do While Plan58.Range("nx" & nx) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("nx" & nx)
    nx = nx + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan61.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan61.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan61.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan61.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan61.Range("d" & linha)
               Lista.SubItems(4) = Plan61.Range("e" & linha)
               Lista.SubItems(5) = Plan61.Range("f" & linha)
               Lista.SubItems(6) = Plan61.Range("g" & linha)
               Lista.SubItems(7) = Plan61.Range("h" & linha)
               Lista.SubItems(8) = Plan61.Range("i" & linha)
               Lista.SubItems(9) = Plan61.Range("j" & linha)
               Lista.SubItems(10) = Plan61.Range("k" & linha)
               Lista.SubItems(11) = Plan61.Range("l" & linha)

linha = linha + 1

Loop
 
End If

    Dim oc As Integer            ''INICIO DA DECLARAÇÃO DA VARIAVÉIS PARA BUSCA DE CREDIARISTA...
  
     oc = 2
  
    Dim oe As Integer
  
     oe = 2
    

    If Me.ComboBox1 = "LC-FL.05" Then               ''CONTAGEM DIVISÃO DE MACRO 55
  
  
    Do While Plan58.Range("oa" & i) <> ""
  
    txtcrediarista.AddItem Plan58.Range("oa" & i)
    i = i + 1
    Loop
  
  
    Do While Plan58.Range("oc" & oc) <> ""
  
    txtanalistacredito.AddItem Plan58.Range("oc" & oc)
    oc = oc + 1
    Loop
  
  
    Do While Plan58.Range("oe" & oe) <> ""
  
    txtjustificativaanalista.AddItem Plan58.Range("oe" & oe)
    oe = oe + 1
    Loop
  
linha = 2                   '' AO SELECINAR A LOJA A LISTVIEW É CARREGADA DE ACORDO COM A LOJA

ListView1.ListItems.Clear

Do While Plan35.Range("b" & linha) <> ""
        
Set Lista = ListView1.ListItems.Add(, , Plan35.Range("a" & linha))
            
               Lista.SubItems(1) = Format(Plan35.Range("b" & linha), "dd/mm/yyyy")
               Lista.SubItems(2) = Format(Plan35.Range("c" & linha), "dd/mm/yyyy")
               Lista.SubItems(3) = Plan35.Range("d" & linha)
               Lista.SubItems(4) = Plan35.Range("e" & linha)
               Lista.SubItems(5) = Plan35.Range("f" & linha)
               Lista.SubItems(6) = Plan35.Range("g" & linha)
               Lista.SubItems(7) = Plan35.Range("h" & linha)
               Lista.SubItems(8) = Plan35.Range("i" & linha)
               Lista.SubItems(9) = Plan35.Range("j" & linha)
               Lista.SubItems(10) = Plan35.Range("k" & linha)
               Lista.SubItems(11) = Plan35.Range("l" & linha)

linha = linha + 1

Loop
 
End If

Call formato_ListView1

End Sub
Valeu... Obrigado.