I get this type mismatch (Error 13) when I try to run the script. Below is the code highlighted error. I'm trying to enter this formula with VBA into the cell but I got an error.
TopVisibleCell.Formula = _
"=IF(ISERROR(LEFT(I2,SEARCH( " - " ,I2)-1)),I2,LEFT(I2,SEARCH( " - " ,I2)-1))"