excel - Deleting duplicates of multiple Columns -


i trying delete multiple columns (5) in excel vba. below code works 4 columns though anymore , seems not work.

dim wb1 excel.workbook set wb1 = workbooks.open("c:\poke.xlsm")   wb1.sheets("sheet1").columns(2).resize(, 4).removeduplicates columns:=array(2, 3, 4), header:=xlno     wb1.savecopyas "c:\poke\zz" + wb1.name wb1.close  end sub 

any ideas? have tried adjusting columns , resize values though seems leaving , adjusting column array 4 works. though data 5 columns. thanks

you should in habit of explaining own code can benefit it. helps others read it. broken down code is:

wb1.sheets("sheet1").columns(8).resize(, 4).removeduplicates columns:=array(1, 2, 3, 4), header:=xlno ''columns = starting column , columns array specifies columns array want , resize specifies how many blanks 

once know that, try out , see if works. news code works fine. need interpret correctly. happy vba-ing.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -