K
KK
Hi,
I have below code for vlookup from different sheets. The problem is the inner loop is not exiting after first condition is met. Like I am getting 3 lookups on the same field (JCell) please help
Set JRng = Sheet2.Range("J8:J10")
Set DRng = Sheet3.Range("D23", Sheet3.Range("D23").End(xlDown))
For Each JCell In JRng.Cells
For Each Dcell In DRng.Cells
JCell.Value = Application.WorksheetFunction.VLookup(Dcell, Sheet4.Range("M:N"), 2, False)
Next Dcell
Next JCell
I have below code for vlookup from different sheets. The problem is the inner loop is not exiting after first condition is met. Like I am getting 3 lookups on the same field (JCell) please help
Set JRng = Sheet2.Range("J8:J10")
Set DRng = Sheet3.Range("D23", Sheet3.Range("D23").End(xlDown))
For Each JCell In JRng.Cells
For Each Dcell In DRng.Cells
JCell.Value = Application.WorksheetFunction.VLookup(Dcell, Sheet4.Range("M:N"), 2, False)
Next Dcell
Next JCell