Need to do this : - > 11111-eu.png
I try with this code
Sub CompileData()
nRow1 = 3
nCol1 = 1
nRow2 = 3
nCol2 = 4
nRowTarget = 100
nColTarget = 1
While Not IsEmpty(Cells(nRow1, nCol1))
Cells(nRowTarget, nColTarget).Value = Cells(nRow1, nCol1).Value
Cells(nRowTarget, nColTarget + 1).Value = Cells(nRow1, nCol1 + 1).Value
nRow2tmp = nRow2 'start from the beginning of second DB everytime
While Not IsEmpty(Cells(nRow2tmp, nCol2 + 1))
If Cells(nRow2tmp, nCol2 + 1).Value = Cells(nRow1, nCol1).Value Then
Cells(nRowTarget, nColTarget + 2).Value = Cells(nRow2tmp, nCol2).Value
nRowTarget = nRowTarget + 1
End If
nRow2tmp = nRow2tmp + 1
Wend
nRowTarget = nRowTarget + 1
nRow1 = nRow1 + 1
Wend
End Sub
but it doesnt work . Someone any ideas what to change ?
Bookmarks