Excel vba MsgBox to display message when duplicate is found -


i trying remove duplicates table in excel, have piece of code removes duplicates without problem, wondering if make prompt message box when duplicate found saying along lines "this entry duplicate entry" suggestions? got far:

sub accesstransfer()     range("a1:f1").select     selection.copy     sheets("sheet2").select      activesheet.paste     activecell.offset(0, 6).value = "oven"      range("a65536").end(xlup).offset(1, 0).select     call godupe     sheets("sheet1").select      application.cutcopymode = false  end sub    sub godupe()      cells.removeduplicates columns:=array(1), header:=xlno     range("a65536").end(xlup).offset(1, 0).select end sub 

rather looping through, identifying , prompting each duplicate, highlight duplicates , prompt user once. godupe() sub this:

sub godupe()  cells.formatconditions.adduniquevalues cells.formatconditions(cells.formatconditions.count)     .dupeunique = xlduplicate     .interior.color = rgb(255, 0, 0) end if msgbox("red highlighted cells duplicated. ok remove duplicates?", vbokcancel) = vbok     cells.removeduplicates columns:=array(1), header:=xlno     range("a65536").end(xlup).offset(1, 0).select end if cells.formatconditions(cells.formatconditions.count).delete 

end sub


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -