assumptions:
- data in sheet1
- row 1 doesn't contain fieldnames
- no empty rows in the usedrange
- 17 columns that contain data
Code:
Sub M_snb()
sn=sheet1.cells(1).currentregion.resize(,17)
with createobject("scripting.dictionary")
for j=1 to ubound(sn)
.item(join(application.index(sn,j,0)))=application.index(sn,j,0)
next
sheet2.cells(1).resize(.count,17)=application.index(.items,0,0)
end with
End Sub
or another method
Code:
Sub M_snb()
sn=sheet1.cells(1).currentregion.resize(,17)
c00=""
for j=1 to ubound(sn)
if instr(c00 & "|" ,"|" & application.index(sn,j,0) & "|") then
sn(j,1)=""
else
c00=c00 & "|" & application.index(sn,j,0)
end if
next
sheet1.cells(1).currentregion.resize(,17)=sn
sheet1.columns(1).specialcells(4).entirerow.delete
End Sub
Bookmarks