Monday 15 September 2014

Excel VBA - RemoveDuplicates method does not work with Mac -



Excel VBA - RemoveDuplicates method does not work with Mac -

i have below piece of code remove duplicates sheet looking 2 columns (column 3 & 5).

lrow = .cells(rows.count, "a").end(xlup).row '.range("a1:br" & lrow).removeduplicates columns:=array(3, 5), header:=xlyes .range("$a$1:$br$" & lrow).removeduplicates columns:=array(3, 5), header:=xlyes

it works fine in windows unfortunately not on mac.

can please suggest me need alter here?

this piece of code create list of unique values , re-create cell. create unique list.

you have specify list starts, , want re-create to. can changing fromcell , tocell variables. hope helps.

sub uniquelist()

fromcell = "a1" tocell = "b1" fromcolumn = mid(fromcell, 1, 1) 'this resolve tocolumn = mid(tocell, 1, 1) 'this resolve b fromrow = mid(fromcell, 2) 'this resolve 1 torow = mid(tocell, 2) 'this resolve 1 dim cl range, uniquevalues new collection, uvalue variant application.volatile numrows = range(fromcell).end(xldown).row on error resume next each cl in range(fromcell & ":" & fromcolumn & numrows) uniquevalues.add cl.value, cstr(cl.value) next cl y = torow - 1 each uvalue in uniquevalues y = y + 1 range(tocolumn & y) = uvalue next uvalue

end sub

excel excel-vba excel-vba-mac

No comments:

Post a Comment