Tuesday 15 September 2015

excel - VBA IF/THEN Find & Replace -



excel - VBA IF/THEN Find & Replace -

i wanted inquire help on how incorporate if-then statement in vba code find's , replaces text.

my situation has several sets of numbers: 8815, 0815, 1234 & 5678 , current code finds "815" , replaces '0815 leading 0 isn't lost. ovbiously issue replace statement executing correctly on 0815 set of numbers , executing on 8815 set of numbers.

how can write command say, if 8815 8815 not alter number if "815" isn't in number?

columns("h").replace what:="815", replacement:="'0815", searchorder:=xlbycolumns

i appreciate help as, i've been looking around few hours , haven't found much on this.

use argument lookat:=xlwhole replace if value in cell value looking for.

excel vba excel-vba

No comments:

Post a Comment