Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
Want to change a value in a Excel table based on a value found through the match function

I want to make a VBA script which can change a value in a table based on a array of values. These values are found through the application.match function. Can somebody help me with this one? I started VBA yesterday, so I am not an advanced user. (found a lot of information through google, but this one was difficult to find). The used code is below

 Dim i As Integer
    For i = 16 To 29
        If ThisWorkbook.Sheets("General").Range("A" & i) = "" Then
        
        Else
        
        MsgBox ThisWorkbook.Sheets("General").Range("A" & i)
            'Find value in Table
            Dim Assignments As Worksheet
            Dim TargetTable As ListObject
            Dim TargetRW As Variant
            
            Set Opdrachten = ThisWorkbook.Sheets("Jobs")
            Set TargetTable = Opdrachten.ListObjects("Assignments")
            
            TargetRW = Application.Match(i, TargetTable.ListColumns(1), 0)
            
            MsgBox TargetRW 'I get an error at this point'
            'Change value in Table
            If Not IsError(TargetRW) Then
                TargetTable.DataBodyRange.Cells(TargetRW, 6) = "Yes"
                
                Else
                
                MsgBox "Error, allready verified."
            End If
    
        End If
    Next i

Thanks in advance

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda