I have a complete list of all sample ID's in column 1.
Column C shows the samples that have been tested for pH (and thier corresponding result in column D)

Column B is a duplicate list which inserts blanks using the following VBA code:
>>> use code - tags <<<
The question: How do I now get the pH result (column D) to match with its corresponding Sample ID in column A?
Any help will be greatly appriciated. Many Thanks.
Column C shows the samples that have been tested for pH (and thier corresponding result in column D)

Column B is a duplicate list which inserts blanks using the following VBA code:
>>> use code - tags <<<
Code:
Sub Listduplicates()
Dim rngA As Range
Set rngA = Range([A1], Cells(Rows.Count, "A").End(xlUp))
rngA.Offset(0, 1).Columns.Insert
With rngA.Offset(0, 1)
.FormulaR1C1 = _
"=IF(ISNA(MATCH(RC[-1],C[1],0)),"""",INDEX(C[1],MATCH(RC[-1],C[1],0)))"
.Value = .Value
End With
End Sub
Any help will be greatly appriciated. Many Thanks.
Last edited by a moderator: