excel - Get adress of cell in function .Find -


i have code below, adress of cell in value if value found. because if macro find existing value in somerange, change value of cell. in advance idea.

range(somerange).select     set = selection.find(what:=something, after:=activecell, lookin:=xlvalues, _     lookat:=xlwhole, searchorder:=xlbyrows, searchdirection:=xlnext, _     matchcase:=false, searchformat:=false) 

you need guard against not finding anything.

dim range range(somerange).select on error resume next set = selection.find(what:=something, after:=activecell, lookin:=xlvalues, _    lookat:=xlwhole, searchorder:=xlbyrows, searchdirection:=xlnext, _    matchcase:=false, searchformat:=false) if not nothing      debug.print a.address(0, 0)      = "changed value" end if 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -