Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am receiving a file daily which contains lots of columns.
Some times, file contains same column twice. I need to check and remove the whole column which is repeated. I only need to check col headings in row 1 for duplicates and not the entire column data. Pl help. Regards, Madiya. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Am Thu, 13 Jun 2013 02:04:51 -0700 (PDT) schrieb Madiya: I am receiving a file daily which contains lots of columns. Some times, file contains same column twice. I need to check and remove the whole column which is repeated. I only need to check col headings in row 1 for duplicates and not the entire column data. your headers in A1:Z1. Then try for column number: =MODE(IF(A1:Z1<"",MATCH(A1:Z1,A1:Z1,))) or for the header: =INDEX(A1:Z1,MODE(IF(A1:Z1<"",MATCH(A1:Z1,A1:Z1,) ))) Both formulas are array formulas to enter with CTRL+Shift+Enter Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Thursday, 13 June 2013 14:34:51 UTC+5:30, Madiya wrote:
I am receiving a file daily which contains lots of columns. Some times, file contains same column twice. I need to check and remove the whole column which is repeated. I only need to check col headings in row 1 for duplicates and not the entire column data. Pl help. Regards, Madiya. Claus, Thanks for reply. I have tried it and it gives me name of 1st duplicate column. If there is more duplicate column, I will not know it unless rest of the macro execution throws error. Also it will be more helpfull if solution is in vba so that a msgbox can be desplayed with each duplicate column name. I am expecting 3 to 5 duplicate columns in general. Thanks again. Regards, Madiya |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Madiya,
Am Thu, 13 Jun 2013 02:35:01 -0700 (PDT) schrieb Madiya: I have tried it and it gives me name of 1st duplicate column. If there is more duplicate column, I will not know it unless rest of the macro execution throws error. Also it will be more helpfull if solution is in vba so that a msgbox can be desplayed with each duplicate column name. I am expecting 3 to 5 duplicate columns in general. then try: Sub DuplicateTest() Dim rngC As Range Dim myStr As String For Each rngC In Range("A1:Z1") If WorksheetFunction.CountIf(Range(Cells(1, 1), _ rngC), rngC) 1 Then myStr = myStr & rngC.Value & " " & _ rngC.Address(0, 0) & Chr(10) End If Next MsgBox myStr End Sub Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to find duplicate values in a column during enter the value? | Excel Discussion (Misc queries) | |||
Find duplicate values in column K then compare cells range of dups | Excel Programming | |||
Find right cell (with duplicate values) | Excel Programming | |||
find a cell matching separate column and row values | Excel Worksheet Functions | |||
Find Empty Column and paste cell values | Excel Programming |