- 21 Ago 2019 às 13:58
#47140
Boa tarde amigos,
Gostaria muito da ajuda de vcs para corrigir meu código de filtro. No filtro eu tenho um critério data (ex.: minha planilha carregar todos os dados do banco com base na data inserida no formulário ou seja carregar todos os dados <01/01/2020). Segue planilha para apoio.
Gostaria muito da ajuda de vcs para corrigir meu código de filtro. No filtro eu tenho um critério data (ex.: minha planilha carregar todos os dados do banco com base na data inserida no formulário ou seja carregar todos os dados <01/01/2020). Segue planilha para apoio.
Código: Selecionar todos
Private Sub btFiltrar_Click()
'Limpa a planilha antes de carregar os dados do filtro
Call LimparRelatório
ultimaLinha = wshBD.Cells(Rows.Count, "A").End(xlUp).Row
lin = 3
For i = 2 To ultimaLinha
If wshBD.Cells(i, 9) < TextBoxData.Value And wshBD.Cells(i, 8) <> 0 Then
wshRel.Cells(lin, 1) = wshBD.Cells(i, 1)
wshRel.Cells(lin, 2) = wshBD.Cells(i, 2)
wshRel.Cells(lin, 3) = wshBD.Cells(i, 3)
wshRel.Cells(lin, 4) = wshBD.Cells(i, 4)
wshRel.Cells(lin, 5) = wshBD.Cells(i, 5)
wshRel.Cells(lin, 6) = wshBD.Cells(i, 6)
wshRel.Cells(lin, 7) = wshBD.Cells(i, 7)
wshRel.Cells(lin, 8) = wshBD.Cells(i, 8)
wshRel.Cells(lin, 9) = wshBD.Cells(i, 9)
wshRel.Cells(lin, 10) = wshBD.Cells(i, 10)
wshRel.Cells(lin, 11) = wshBD.Cells(i, 11)
lin = lin + 1
End If
Next
Call Formata_Relatorio
End Sub
Private Sub TextBoxData_Change()
'Inserir as barras na data
If Len(TextBoxData.Text) = 2 Then
TextBoxData = TextBoxData + "/"
End If
If Len(TextBoxData.Text) = 5 Then
TextBoxData = TextBoxData + "/"
End If
End Sub
Você não está autorizado a ver ou baixar esse anexo.