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

javascript - Can Piwik report referrer in real time? -

asp.net - Google Drive Access: At least one client secrets (Installed or Web) should be set -

excel vba add hyperlink to shape in group -