0

I have been trying to automate my spreadsheet where each cell removes all characters before the symbol ">". The formula I am using works when I input into the spreadsheet manually which returns all the information I need after the symbol ">" . However when inputting this into VBA It keeps adding a space to both sides of the symbol " > " and the result now displays "TRUE". I was reading that the formula may need double quotes but when adding double quotes "">"" the formula does not work. Any help is appreciated. Thank you!

Formula

=IFERROR(MID(D2,SEARCH(">",D2)+2,2000),D2)

Formula when entered into VBA - (Space Gets Added)

Range("E2").Formula = "=IFERROR(MID(D2,SEARCH(" > ",D2)+2,2000),D2)"
Tim Williams
  • 154,628
  • 8
  • 97
  • 125

1 Answers1

1

you will have to add an extra pair of double quotation marks within the ones you have in your formula. So you would end up with =IFERROR(MID(D2,SEARCH("">"",D2)+2,2000),D2)

  • thank you for confirming that. For some reason it would not work for me. I updated my excel version and now it is working. – Help_Please Sep 06 '22 at 16:32