cancel
Showing results for 
Search instead for 
Did you mean: 

How to Remove duplicate columns inside excel

Venkata_NitishM
Level 3
Hi, I have an excel sheet, in that i have a duplicate data, how can i remove duplicate data, i read excel sheet data in the form of collection, here i need to do compare the collections how i can do comparision??
13 REPLIES 13

SurajJadhav
Level 5
Hello nitish, You mean to say you have duplicate rows of same data or you have duplicate columns

I want to remove duplicate rows of data for columns in excel sheet

SurajJadhav
Level 5
Okay. You can use work queue to do that First you have to create a new queue enter key name field, the column name of your collection for eg Name or Id.We will remove remove duplicate data which contains same name or Id. Now use collection loops we will add collections data to queue one by one. Add Action stage in loop stage select business object work queue->select action -> Is Item In queue. create output data item which is flag type. Next Add decision Stage below action and check for flag if flag is true we will not add this data to queue just skip this and add link back to loop start. If flag is false for this add action to enter data in queue. here u need to use one temp collection where u store current row of collection. pass this collection as input to add queue. After all loop execution is done You can read queue data which contains your data which is not duplicate data. this is quite complex but it will help. If u don't understand anything reply but try to read it and implement i know its not efficient but it will give you desired output

Our you can do it manual in Excel. 1. Select the range of cells, or make sure that the active cell is in a table. 2. On the Data tab, in the Data Tools group, click Remove Duplicates. 3. Do one or more of the following: * Under Columns, select one or more columns. * To quickly select all columns, click Select All. * To quickly clear all columns, click Unselect All. 4. Click OK. (A message is displayed indicating how many duplicate values were removed and how many unique values remain, or if no duplicate values were removed.) 5. Click OK. You can easily make a program that does this, or do it manual if it is to hard 🙂

SudheerReddy
Level 4
You can use a macro to remove duplicates:Use Action -> MS Excel VBO -> Run Macro Use the below macro: Sub RemoveDuplicates() Cells.RemoveDuplicates Columns:=Array(1, 2, 3) End Sub For this to work, first you have to Write the data to Macro work book and then after running the macro, copy the data back to a new collection to write it in new excel.

RathishKN1
Level 2
Hi , Inorder to remove the duplicates I did the following steps: 1. got the worksheet values into the collection.(this can be used by using ""get worksheet values as collection "" from action in Excel Business Object). 2. wrote a code stage in C# to remove duplicates as below: Datatable dt; dt=InputColl; // passing input coll as input parameter OutputColl=dt.DefaultView.ToTable(/*distinct*/true);// OutputColl as output parameter

Hi sudheer, how to write data to macro work book and where to write below macro code, i mean to say can u elaborate clearly..

Hi, I need little bit clearly can u elobarate it as much as u can..

PrateekMehan
Level 6
Use global send Keys: Alt+A+M