Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por Diegonsf
Posts
#43515
Bom, estou tentando fazer uma pesquisa com 2 colunas, preciso que fazer uma busca de data em 2 colunas diferente e que ele me retorne no listbox, o código que uso é esse.

Botão Localizar
Código: Selecionar todos
Dim Linha As Integer
Dim Linhalistbox As Integer
Dim data As Date
Dim Inicio As Date
Dim Fim As Date

Inicio = txt_datainicio
Fim = txt_datafinal

Linhalistbox = 0
Linha = 2

ListBox.Clear

With Plan13
While .Cells(Linha, 1).Value <> ""
data = .Cells(Linha, 36).Value
If data >= Inicio And data <= Fim Then

With ListBox
.AddItem
.list(Linhalistbox, 0) = Plan13.Cells(Linha, 1)
.list(Linhalistbox, 1) = Plan13.Cells(Linha, 2)
.list(Linhalistbox, 2) = Plan13.Cells(Linha, 3)
.list(Linhalistbox, 3) = Plan13.Cells(Linha, 4)
.list(Linhalistbox, 4) = Plan13.Cells(Linha, 5)
.list(Linhalistbox, 5) = Plan13.Cells(Linha, 6)
.list(Linhalistbox, 6) = Plan13.Cells(Linha, 7)
.list(Linhalistbox, 7) = Plan13.Cells(Linha, 8)
.list(Linhalistbox, 8) = Plan13.Cells(Linha, 9)
.list(Linhalistbox, 9) = Plan13.Cells(Linha, 10)
End With
Linhalistbox = Linhalistbox + 1
End If
Linha = Linha + 1
Wend
End With
se alguem tiver alguma sugetão de como posso fazer.
Por babdallas
#43625
Sugiro que você anexe a pasta de trabalho.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord