Remove Duplicates from range of cells in excel vba

You need to tell the Range.RemoveDuplicates method what column to use. Additionally, since you have expressed that you have a header row, you should tell the .RemoveDuplicates method that. Sub dedupe_abcd() Dim icol As Long With Sheets(“Sheet1”) ‘<-set this worksheet reference properly! icol = Application.Match(“abcd”, .Rows(1), 0) With .Cells(1, 1).CurrentRegion .RemoveDuplicates Columns:=icol, Header:=xlYes End With … Read more

Excel: Searching for multiple terms in a cell

Another way =IF(SUMPRODUCT(–(NOT(ISERR(SEARCH({“Gingrich”,”Obama”,”Romney”},C1)))))>0,”1″,””) Also, if you keep a list of values in, say A1 to A3, then you can use =IF(SUMPRODUCT(–(NOT(ISERR(SEARCH($A$1:$A$3,C1)))))>0,”1″,””) The wildcards are not necessary at all in the Search() function, since Search() returns the position of the found string.