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
Por FernandoAC
Posts
#16600
Pessoal Boa noite,
Eu estou fazendo um cadastro diário onde funcionário vai por algumas informações e vai separar para 6 abas de planilhas no Excel...
Exemplo ele vai preencher Destinatarios, Sec. Responsavel, Correspondência, Remetente e Data.
Existe 5 Secretarias responsáveis e outra determinada "Outras" Quando Funcionário preencher o campo Sec. Responsável eu quero que aquela linha seja seja copiada para aba do responsável...
Estou mandando a planilha pra vocês entenderem melhor
Avatar do usuário
Por Deciog
Avatar
#16617
FernandoAC Bom Dia.

Sei fazer com formula confere se atende, lembrando é matricial deve digitar CTRL+SHIT+ENTER

Décio
Avatar do usuário
Por alexandrevba
Avatar
#16619
Bom dia!!

Segue minha contribuição.
Código: Selecionar todos
Sub AleVBA_3328()
Dim Names As String
Dim cell
Dim sht As Worksheet
    With ThisWorkbook.Worksheets("Geral")
        For Each cell In .Range("B4", .Range("B4").End(xlDown))
            For Each sht In ThisWorkbook.Worksheets
                If sht.Name = cell.Value Then
                    sht.Activate
                    .Range("A" & cell.Row & ":F" & cell.Row).Copy
                    sht.Range("A" & sht.Rows.Count).End(xlUp).Offset(1, 0).Select
                    ActiveSheet.Paste
                End If
            Next sht
        Next cell
    End With
End Sub
Faça os testes, favor adaptar se necessário!

Obs: Se os nomes na coluna Sec. Responsavel estiver diferente dos nomes das guias, será descartado os dados, ou seja não será copiado.
Ex: na coluna da guai Geral está com Fied o nome da guia está como Fried

Att
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