try changing like
if it still fails make sure that instr for Vendor is not = 0, though it may not matter if it istot = instr(1, thebody,"TOTAL AMT") if tot > 0 then mynumber = mid(thebody, tot + 9, instr(tot, thebody, "VENDOR") - tot - 9) else msgbox "TOTAL AMT not found" end if
this will also be quicker (though maybe not noticeable), than 3 calls to instr total amt




Reply With Quote