excel - Replace function with wildcard -
currently have developed operation tool compares complex engineering source files of dcs. therefore have replace 'tagnames'.
the code replacing applies:
g = 8 amountofreplace 'replace string every potential transition sheets("compare") orgi = .range("l" & g).value copy = .range("j" & g).value tmp_string = replace(tmp_string, copy, orgi) end an example tmp_string = 200tt-50 or 200tx-50 or 200gg-50
this should transititioned 350tt-50 or 350tx-50 or 350gg-50
so right add transitions 200tt --> 350tt 200tx --> 350tx
but prefer appy transition 200$$ --> 350$$
$ mean character [a-z] when gets applied directly apply transitions mentioned above.
wildcard not work replace function.. has clue? because fill in different transitions time. regex doesn't seem solution me.
thanks in advance,
you can use vba.left() in
if vba.left(tmp_string, 3) = "200" tmp_string = "350" & vba.right(tmp_string, len(tmp_string)-3) end if
Comments
Post a Comment