I want to write a formula with type into excel in excel. There are [ ] characters in the formula I will write. It gives an error

I wrote a formula to get the word in a cell in Excel.
The formula I wrote: =FILTERXML(“”&SUBSTITUTE(AB2;“|”;“”)&“”;“//s[5 ]”)
This formula helps me to separate the sentence in the 5th line from the sentence of 10 lines inside the cell.
However, type into gives an error in square brackets written in the formula.
The line I typed into Type into: “=FILTERXML(”+Chr(34)+“<”+“t”+“>”+“<”+“s”+“>”+Chr(34)+“&”+ “SUBSTITUTE(AB2”+“;”+Chr(34)+“|”+Chr(34)+“;”+“<”+“/”+“s”+“>”+“<”+“s “+”>”+Chr(34)+“)”+“&”+Chr(34)+“<”+“/”+“s”+“>”+“<”+“/”+“t “+”>”+Chr(34)+“;”+Chr(34)+“/”+“/”+“s”+“[”+“2”+“]”+Chr(34)+" )"

I typed Chr(91) and Chr(93) instead of square brackets but it didn’t accept. it gave error again. Anyone have a suggestion?


In TypeInto default mode or SendWindowMessage mode, [ is handled as special character. So can you try to escape it like [[?



Very Very thx

1 Like

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