How to look up a result using vlookup with a variable as the look up value in VBA?

StackOverflow https://stackoverflow.com/questions/21713382

  •  10-10-2022
  •  | 
  •  

Frage

How to look up a result using vlookup with a variable as the look up value in VBA?

Example:

Dim JobNumber

ActiveCell.FormulaR1C1 = _
        "=(VLOOKUP(JobNumber,'Job List'!C[1]:C[4],1,FALSE)
War es hilfreich?

Lösung

as simple as this:

Dim JobNumber 

ActiveCell.FormulaR1C1 = _
        "=VLOOKUP(" & JobNumber & ",'Job List'!C[1]:C[4],1,FALSE)"
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top