Hi All,
my vba below works well but I need to enhance it. I want that if Sheets("Output).Cells(i, 1) is blank, then cell Sheets("Output).Cells(i, 7) becomes blank too. I was trying a lot to add ElseIf to the actual code but I could not make it work. Can you help how to add ElseIf appropriately? Thanks.
my vba below works well but I need to enhance it. I want that if Sheets("Output).Cells(i, 1) is blank, then cell Sheets("Output).Cells(i, 7) becomes blank too. I was trying a lot to add ElseIf to the actual code but I could not make it work. Can you help how to add ElseIf appropriately? Thanks.
VBA Code:
For j = 2 To OutputRow
Dim lookupVal_2 As Range
Dim myString_2 As Variant, Rng1$
On Error Resume Next
Set lookupVal_2 = Sheets("Output").Cells(j, 5)
Rng1 = Range(Cells(2, 3), Cells(InputRow, 3)).Address
myString_2 = WorksheetFunction.VLookup(lookupVal_2, Sheets("Input").Range(Rng1), 1, False)
If Err.Number > 0 Then
Sheets("Output").Cells(j, 7) = "action 1"
Err.Clear
Else
Sheets("Output").Cells(j, 7) = "action 2"
End If
Next j