Tuesday, 15 June 2010

excel - Vlook up from different sheet with VBA -


text => itemprop = "text">

I am trying to vlookup from Sheet 1 column B, I have my reference value in sheet 2 in column B. Below is my code. I am trying to see with the help of VBA but only the first line is getting populated. The rest are not getting the population. Can someone help me?

  sub VL set rngLast = range ("B1") offset (rows.Count1) .Range with "xlUp" ("B2", RNGLust) Offset (0, 0). Formula 1C1 = "= VLOOKUP (RC [1], Sheet 2! C [-1]: C, 2.0)". Value = .offet (0, 0). Value   

Ensure that you want to get the last line based on . Column B ? It looks as if the value in column A , which depends on the last line, try:

  sub VL (set) rngLast = range ("A1 ") Offset (rows.Count-1). End (xlUp). Offset with range (0, 1) "B2", RNGLEST). Formula 1 C1 = "= VLOOKUP (RC [-1], Sheet 2! C [-1]: C, 2.0)". Value =. End end with sub ending  

No comments:

Post a Comment