excel - Range Object Error -
i trying use find function find 'one site:' there, clear whatever on right. facing application defined error on line suppose clear. think might have done wrongly. if told me have done wrongly
dim r range set r = sheet2.range("e:m").find(what:="one site:", _ after:=sheet2.range("e3"), _ lookin:=xlvalues, lookat:=xlpart) if not r nothing r.end(xlright).clearcontents 'error on line end if
this should after, need change xlright xltoright, , little clear on right.
option explicit sub so45316709() dim r range, r2 range on error resume next set r = sheet2.range("e:m").find(what:="one site:", after:=sheet2.range("e3"), lookin:=xlvalues, lookat:=xlpart) on error goto 0 if not r nothing set r2 = r.end(xltoright) sheet2.range(r.offset(0, 1), r2).clearcontents end if end sub
Comments
Post a Comment