how do create a formula

R

RJSads

I have 2 columns in a worksheet #1
Column 1 Client Code
Cloumn 2 Client Type


In Worksheet #2 i have the same columns

If i populate Column 1 in worksheet #2 with a client Code how do i input the
Client Type based on the information in Worksheet #1

Thanks
 
B

Bernie Deitrick

If they are the same columns (say, A and B) on each sheet:

With Worksheets("Worksheet #2")
..Range(.Cells(2, 2), .Cells(.Cells(Rows.Count, 1).End(xlUp).Row, 2)).FormulaR1C1 = _
"=VLOOKUP(RC[-1],'Worksheet #1'!C[-1]:C,2,FALSE)"
End With

HTH,
Bernie
MS Excel MVP
 
Top