I am completely stumped on something that seems so simple. I have searched and searched and have yet to find code to solve
I have two worksheets (build and itrw01).
I am using match index to match buildsheet, col a to itw01sheet, col d, then copy the value from itw01sheet, col e to
buildsheet col d.
the code works for this, but I really want to copy columns e,g,h,i to the build worksheet. This
is where I fail. Any ideas?
Dim vmatch2 As Variant
Dim rngcell As Range
Dim wssource As Worksheet
Set wssource = Sheets("itrw01")
Dim buildsheet As Worksheet
Set buildsheet = Sheets("Build")
Dim lastrowindex As Long
Dim lastrowlu As Long
lastrowindex = Range("a65536").End(xlUp).Row
'lastrowlu = Range("e65536").End(xlUp).Row
For Each rngcell In buildsheet.Range("d11:d" & lastrowindex)
vmatch2 = Application.Match(buildsheet.Cells(rngcell.Row, "a"), wssource.Range("d11:d" & lastrowindex), 0)
If IsNumeric(vmatch2) Then
rngcell.Value = Application.Index(wssource.Range("e11:e" & lastrowindex), vmatch2)
'rngcell.Value = Application.Index(buildsheet.Range("a11:a" & lastrowindex), vmatch2)
rngcell.Value = "no match"
Set wssource = Nothing
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines