Exclude copying duplicate values (Excel VBA) -
i'm automating copying html table excel duplicates must deleted or excluded in being copied. code below, copy values html table cells transpose/copy again cells. cannot figure out way on how exclude duplicate values being paste final cells.
there button wherein copied value paste excel. there 10 rows in every html table.
code:
option explicit private sub hand_over_click() application.screenupdating = false dim e, m, integer, k variant range("xet1").select activesheet.pastespecial format:="html", link:=false, displayasicon:= _ false, nohtmlformatting:=true columns("e").numberformat = "mmm dd yyyy h:mm:ss am/pm" columns("i").numberformat = "ddd" e = 6 m = 1 while not range("c" & e) = "" e = e + 1 wend = 5 1000 if activesheet.cells(a, 5).value <> "" if range("xev" & m) <> "" range("c" & e).value = range("xeu" & m).value range("f" & e).value = range("xfd" & m).value k = split(split(split(range("xev" & m).value2, ") :")(1), "):")(0), " req(") range("e" & e) = datevalue(mid(k(1), 5, 7) & right(k(1), 4)) + timevalue(mid(k(1), 12, 8)) range("d" & e) = k(0) range("i" & e).value = date e = e + 1 m = m + 1 end if end if next activesheet.range("xet1:xfd50").clear application.screenupdating = true end sub
how removeduplicates before transpose/copy it..
range("xet1:xfd50").select activesheet.range("xet1:xfd50").removeduplicates columns:=array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), header:=xly
Comments
Post a Comment