0

Following is the vba code, (just inserted formula in vba)

Sub xyz()
Range("H2").Formula = "=TEXTJOIN(";",TRUE,FILTERXML("<t><s>"& SUBSTITUTE(SUBSTITUTE(A2,"/","</s><s>"),";","</s><s>")&"</s></t>","//s[not(contains(., '.'))]"))"
Range("H2", "A" & Cells(Rows.Count, 1).End(xlUp).Row).FillDown
End Sub

But i get this error: highlighting ";" next to textjoin.

enter image description here

Please help to correct this code.

10
  • May i know which comma you are talking about? Commented Jul 11, 2022 at 3:42
  • Get it all working on one line first - it's much easier. Commented Jul 11, 2022 at 3:43
  • I have made it in one line, but still it gives the same error Commented Jul 11, 2022 at 3:47
  • 2
    You need to escape your double quotes inside your formula Commented Jul 11, 2022 at 3:53
  • 2
    @Lote_marsk_chozey re but does not provide the expected output. That would be a new question. This one has been answered (escape your quotes) Commented Jul 11, 2022 at 5:00

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.