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 JeffSchultz
Posts
#46081
Olá,

Precisava uma maneira de transpor dados onde a coluna A está duplicado e coluna C são dados exclusivos, gostaria de inserir os dados duplicados em novas colunas.
Você não está autorizado a ver ou baixar esse anexo.
#46084
Olá,
resolvi o seu problema com um Script em VBA, se eu entendi direito, claro.

Basta jogar num módulo
Código: Selecionar todos
Sub OrganizarLinhas()
Dim UltimaLinha As Integer

Plan4.Activate  'Alterar pra sua planilha

UltimaLinha = Range("A2").End(xlDown).Row


For i = 2 To UltimaLinha

    For j = 3 To UltimaLinha
        
        If i = j Then GoTo Proximo
        If Cells(i, 1).Value = Cells(j, 1).Value Then
            
            'Transferir
            If Cells(i, 4).Value = Empty Then
                Cells(i, 4).Value = Cells(j, 3).Value
            ElseIf Cells(i, 5).Value = Empty Then
                Cells(i, 5).Value = Cells(j, 3).Value
            Else
                Cells(i, 6).Value = Cells(j, 3).Value
            End If
            
            'Excluir linha antiga
            ActiveSheet.Rows(j & ":" & j).Delete Shift:=xlUp
            
            UltimaLinha = UltimaLinha - 1
        End If
Proximo:
    Next
Next
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