I have this code. it seens to work on the 3 first(row 2 ,3,4) line of data but seens to fail on all other of the line then that like this row 5
any idear why ?
Dim rownr
rownr = 4
Do Until Cells(rownr, 1).Value = ""
sal = ""
Dim E_name As String
E_name = ""
E_name = CStr(Ark1.Cells(rownr, 1).Value)
MsgBox (E_name)
'Why does this line fail ?
sal = Application.WorksheetFunction.VLookup(E_name, Ark1.Range("A:D"), 3, False)
'line end
MsgBox "Salary is : $ " & sal
sal = ""
rownr = rownr + 200
Loop
End Sub
any idear why ?
Dim rownr
rownr = 4
Do Until Cells(rownr, 1).Value = ""
sal = ""
Dim E_name As String
E_name = ""
E_name = CStr(Ark1.Cells(rownr, 1).Value)
MsgBox (E_name)
'Why does this line fail ?
sal = Application.WorksheetFunction.VLookup(E_name, Ark1.Range("A:D"), 3, False)
'line end
MsgBox "Salary is : $ " & sal
sal = ""
rownr = rownr + 200
Loop
End Sub