Hi! I am new in VBA. I copied this code from other source. This code populates only one (1) result which is in column C13, my lookup value are in Sheet1 B13:B31. I want to display the result also in other column which is in H13. My Table array are in Sheet4 column A:E. My codes are below:
Sub Vlookup()
Dim c As Range, v, v1, v2, rngSearch As Range
Set rngSearch = Sheet4.Range("A:E")
For Each c In Sheet1.Range("B13:B31").Cells 'loop the input range
v = c.Value
If Len(v) > 0 Then 'is there anything to look up?
'drop the `WorksheetFunction` to prevent run-time
'error if there's no match
v1 = Application.Vlookup(v, rngSearch, 3, False)
c.EntireRow.Columns("C").Value = IIf(IsError(v1), "Please Write Manually the Item Description", v1) ' "-" if no match
End If
Next c
End Sub
Sub Vlookup()
Dim c As Range, v, v1, v2, rngSearch As Range
Set rngSearch = Sheet4.Range("A:E")
For Each c In Sheet1.Range("B13:B31").Cells 'loop the input range
v = c.Value
If Len(v) > 0 Then 'is there anything to look up?
'drop the `WorksheetFunction` to prevent run-time
'error if there's no match
v1 = Application.Vlookup(v, rngSearch, 3, False)
c.EntireRow.Columns("C").Value = IIf(IsError(v1), "Please Write Manually the Item Description", v1) ' "-" if no match
End If
Next c
End Sub