Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!