vba - How to handle wild characters in Macros? -
i have wrote piece of code replace characters, doesn't work fine *
. can 1 guide how can handle *
.
here code:
nextrow = activecell.row tocolnbr = activecell.column columns(tocolnbr).select selection.replace what:="'", replacement:="", lookat:=xlpart, _ searchorder:=xlbyrows, matchcase:=false, searchformat:=false, _ replaceformat:=false
use ~
tilde per office support.
microsoft excel uses tilde (~) marker indicate next character literal. when use find , replace dialog box find or replace character such tilde (~), asterisk (*), or question mark (?), must add tilde (~) before character in find box.
so must this:
selection.replace what:="~*", replacement:="", lookat:=xlpart, _ searchorder:=xlbyrows, matchcase:=false, searchformat:=false, _ replaceformat:=false
Comments
Post a Comment