nugol
03-15-2016, 12:42 AM
Hy guys,
I am trying to solve something and I am not entirely sure how to.
The goal is:
If the cells are empty then excel makes a vlookup. This part works so far.
In the second part it should make a vlookup if it is not empty and if vllokup has a certain value.
In the third part excel should just do nothing if the cell is not empty and vlookup does not have the desired value.
Sub Knowcells()
For i = 1 To 10
If IsEmpty(Cells(i, 1)) Then Cells(i, 1).FormulaR1C1 = "=VLOOKUP(RC[-2],RC[9]:R[1]C[10],2,0)"
ELSEIF ('Cell is not empty, Then vlookup, if vlookup has certain value (x,v or t))
ELSEIF ('Cell is not empty and vlookup does not has desired value Then just leave everything like it is.)
Next i
End Sub
I tried a few things like call or function but I really donn't get them.
Thanks in advance for your time
I am trying to solve something and I am not entirely sure how to.
The goal is:
If the cells are empty then excel makes a vlookup. This part works so far.
In the second part it should make a vlookup if it is not empty and if vllokup has a certain value.
In the third part excel should just do nothing if the cell is not empty and vlookup does not have the desired value.
Sub Knowcells()
For i = 1 To 10
If IsEmpty(Cells(i, 1)) Then Cells(i, 1).FormulaR1C1 = "=VLOOKUP(RC[-2],RC[9]:R[1]C[10],2,0)"
ELSEIF ('Cell is not empty, Then vlookup, if vlookup has certain value (x,v or t))
ELSEIF ('Cell is not empty and vlookup does not has desired value Then just leave everything like it is.)
Next i
End Sub
I tried a few things like call or function but I really donn't get them.
Thanks in advance for your time