The error when write formula in excel

when use the below value for the “what to write”, there is error like this. Can anyone help solve it?
= value(ISNUMBER(MATCH(K"& CurrentRow & “,” & MatchList.Sheet(“客商信息”).Range(“A:A”) & " ,0)))

@jackie.yue

Please check this

"=value(ISNUMBER(MATCH(K" + CurrentRow + "," + MatchList.Sheet("客商信息").Range("A:A") + " ,0)))"

I hope these two are variables - CurrentRow ,MatchList.Sheet(“客商信息”).Range(“A:A”)

cheers

still occured error like this:

@jackie.yue

You missed the starting and ending double quotes

cheers

BelwBelow is the waring with the two double quotes.

@jackie.yue

currentrow is not a string/?

where are you getting it …what does it hold?

it says that the type is CurrentRowQuickHandler…it should ideally be string containign a integer value for indicating row number I believe

I guess its the currentrow from the for each row in excel …if you need currentrow index then use currentIndex.ToString and generally it starts from zero so use like this (currentIndex+2).ToString(assuming data starts from row 2 in excel)

cheers

Thanks Anil,
The currentrow is from the for each row in excel. I revised as below, but there is still error.
“=value(ISNUMBER(MATCH(K” + CurrentIndex.ToString & “,” + MatchList.Sheet(“客商信息”).Range(“A:A”) +" ,0)))"

@jackie.yue

Now MatchList.Sheet("Name").Range("A:A") will return a Rangevalue type variable …I guess you need to directly give "A:A" without anything else…if its a different sheet then give "Sheetname!A:A"

final formula : "=value(ISNUMBER(MATCH(K" + CurrentIndex.ToString + ",客商信息!A:A,0)))"

or "=value(ISNUMBER(MATCH(K" + CurrentIndex.ToString + ",A:A,0)))"

cheers

Thanks Anil, the final expression is correct.
“=value(ISNUMBER(MATCH(K” + CurrentIndex.ToString+ “,A:A” +" ,0)))"

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.