Hello all
I am trying to do the following
If the cell range "K" is blank complete a Vlookup
If the cell range "K" has data in do not perform a Vlookup so that the data remains in the cell, any help on this would be great please.
This is some code that two of our Excel forum members helped me with for another issue which is similar but works on the cell in the sheet called "Data" being blank and I have tried to modify this
I am trying to do the following
If the cell range "K" is blank complete a Vlookup
If the cell range "K" has data in do not perform a Vlookup so that the data remains in the cell, any help on this would be great please.
Code:
With Range("K1:K" & LastRow)
.FormulaR1C1 = "=VLOOKUP(RC[-10],Data!C[-10]:C[3],14,FALSE)"
.Value = .Value
End With
This is some code that two of our Excel forum members helped me with for another issue which is similar but works on the cell in the sheet called "Data" being blank and I have tried to modify this
Code:
With Sheets("Data")
arr = .Cells(1, 1).Resize(.Cells(.Rows.Count, 1).End(xlUp).Row, 14).Value
End With
For x = LBound(arr, 1) To UBound(arr, 1)
dic(arr(x, 1)) = arr(x, 14)
Next x
With Sheets("Comments")
arr = .Cells(1, 1).Resize(.Cells(.Rows.Count, 1).End(xlUp).Row, 11).Value
For x = LBound(arr, 1) To UBound(arr, 1)
If dic.exists(arr(x, 1)) Then arr(x, 11) = dic(arr(x, 1))
Next x
.Cells(1, 11).Resize(UBound(arr)).Value = Application.Index(arr, 0, 11)
End With