vba - index match return NA value -


i have vba code find value @ intersection of columns , rows. works data except 1 : returns na. value want return same usual, doesn't work intersection. can me figure out why? thank you

with perftitres set vmt = data1.range("u:u") set ticker = data1.range("h:h") end      ' calculs de perf    each sht in perftitres.worksheets     if sht.visible = true             if sht.cells(1, 1) = ""             sht.cells(1, 1) = "date"             sht.cells(1, 2) = "code du placement"             sht.cells(1, 3) = "valeur marchande t"             sht.cells(1, 4) = "valeur marchande t-1"             sht.cells(1, 5) = "valeur des achats"             sht.cells(1, 6) = "valeur des ventes"             sht.cells(1, 7) = "facteur"             sht.cells(1, 8) = "rendement 1 mois"             end if     lastrowsht = sht.cells(sht.rows.count, "a").end(xlup).row      lastcolumnsht = sht.cells(1, sht.columns.count).end(xltoleft).column      sht.cells(lastrowsht + 1, 1) = 20 & left(dateupdate, 2) & "-" &   right(dateupdate, 2)     sht.cells(lastrowsht + 1, 2) = sht.name     sht.cells(lastrowsht + 1, 3) = application.index(vmt, application.match(sht.cells(lastrowsht + 1, 2), ticker)) end if next sht  data1.visible = true data2.visible = true 

this line doesn't work expected 1 sheet. every other 1 works.

   sht.cells(lastrowsht + 1, 3) = application.index(vmt, application.match(sht.cells(lastrowsht + 1, 2), ticker)) 

i found answer :

    sht.cells(lastrowsht + 1, 3) = application.index(vmt,    application.match(sht.cells(lastrowsht + 1, 2), ticker,0),0) 

i had had 0 , 0 exact matches


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -