vba - Replace application.vlookup with vlookup(R1C1..) -


i'm using application.worksheetfunction vlookup follows:

for = 4 lastrow     cells(i, 35) = application.worksheetfunction.iferror(application.vlookup(cells(i, 12), sheets("risk explorer greeks").range("a1:c50000"), 3, 0), cells(i, 15)) next 

as takes long time i've tried replace using following code:

range("ai:ai" & lastrow).formular1c1 = "=iferror(vlookup(rc[-21],'risk explorer greeks'!r2c1:r50000c3, 3, false),"range("o4:o" & lastrow)" 

however it's giving me error, believe because of last piece of code comes in play when error occurs. in first bit of code, if vlookup failed in cell 50, iferror lookup value in row 15 column 50 , give back. i'm trying achieve second bit of code i'm using, doesnt seem work. can me out pls?

i've been playing around while can't seem resolve!

you're missing start row range object, , want value in column 15 of current row in formula so:

range("ai4:ai" & lastrow).formular1c1 = "=iferror(vlookup(rc[-21],'risk explorer greeks'!r2c1:r50000c3, 3, false),rc15)" 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -