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.
  • Avatar do usuário
  • Avatar do usuário
#48623
Senhores,
Preciso por favor, de um comando de busca em VBA (ou função) que me busque da planilha BDados as informações relacionadas as referências: "Grupo, mês e anos" que forem selecionadas.
Estou anexando um arquivo modelo para melhor entendimento
Agradeço antecipadamente suas colaborações
Você não está autorizado a ver ou baixar esse anexo.
#48694
Segue uma alternativa.
Código: Selecionar todos
Sub BuscaDados()
 If Application.CountA([B3], [D3], [F3]) < 3 Then Exit Sub
 If [B6] <> "" Then Range("B6:H" & Cells(Rows.Count, 2).End(3).Row).Value = ""
 With Sheets("BDADOS")
  .AutoFilterMode = False
  .[A1:I1].AutoFilter 3, [B3]
  .[A1:I1].AutoFilter 4, [D3]
  .[A1:I1].AutoFilter 5, [F3]
  If .AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Count > 1 Then
   .Range("B2:B" & .Cells(Rows.Count, 1).End(xlUp).Row).Copy [B6]
   .Range("D2:I" & .Cells(Rows.Count, 1).End(xlUp).Row).Copy [C6]
  End If
  .AutoFilterMode = False
 End With
End Sub
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