Lookup If Blank


Sub vlkP_blankfild()
Dim i As Long
Dim k As Integer
For i = 2 To Sheet2.Range("A1048576").End(xlUp).Row
k = Application.VLookup(Cells(i, "A"), Sheets("sheet1").Range("A1:C" & Sheet1.Range("A1048576").End(xlUp).Row), 3, 0)
If Cells(i, "D").Value = "" Then
Cells(i, "D") = k
End If
Next
End Sub

Comments

Popular posts from this blog

50 Excel VBA Oral Interview Questions