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
Por Abel
Posts
#66174
Boa tarde, gostaria de saber como posso estar localizando e substituindo dados da mesma linha que foi localizado?
Exemplo e explicação na planilha anexada. Por favor alguem poderia me ajduar?
Você não está autorizado a ver ou baixar esse anexo.
#66175
Tente assim:
Código: Selecionar todos
Sub SetorAmbiente()
    Dim rng As Range, C As Range, pedAlt As Range
    With ThisWorkbook
    .Activate
    With .Sheets("FORM") 'Planilha origem
        Set rng = .Range("E6")
        For Each C In rng
            With Sheets("INVENTARIO") 'Planilha Destino

                Set pedAlt = .Columns(3).Find(C.Value, LookIn:=xlValues, LookAt:=xlWhole) 'Procura na coluna C de INVENTARIO

                If Not pedAlt Is Nothing Then '<-Se encontrar...copia de origem para destino
                   pedAlt.Offset(, 1).Value = C.Offset(8, 0).Value 'INVENTARIO D = FORM E14
                   pedAlt.Offset(, 2).Value = C.Offset(10, 0).Value 'INVENTARIO E = FORM E16
                End If

            End With

        Next

    End With
    End With
    MsgBox "FIM"
End Sub
Abel agradeceu por isso
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