VBA Excel - I need to replace this= ,""F with this= ,"F but not where it is this= ,"", -


sorry title seems confusing. there workbook large amounts of data trying write macro for. find/replace specific data have.

for example: replace: ,""micky mouse, inc."","donald duck","",

with: ,"micky mouse, inc.","donald duck","",

i need last ,"", left alone. i'm not sure how write exactly.

i prefer not program each example these proper names continuing added , prefer not have re-write vba code each time.

thanks in advance!

you initial replace of empty quotes , normal replace. straightforward method.

sub custfindreplace(srchrng range)     dim c range     each c in srchrng.cells         c.value = replace(c.value, ","""",", ","""""""",")         c.value = replace(c.value, """""", """")     next c end sub 

if logic remains simple, more efficient method (as siddarth suggested) should use built-in find/replace:

sub custfindreplace(srchrng range)     srchrng.replace what:=","""",", replacement:=","""""""",", lookat:=xlpart     srchrng.replace what:="""""", replacement:="""", lookat:=xlpart end sub 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -