PDA

View Full Version : Compare Column



Foncesa
06-21-2013, 02:09 PM
Hi,
Can someone please help me how to create a VBA Program to Compare Column in Excel (in my case its Column D 'Name')

First it will compare the Names and then change there Unique No. because they are different, based on Reference (Column 'B') with priorty basis.

For Example.

Case 1. The Column B has two different References for the same Name (Column D) then Unique No. of 1001 will be set for 1002.

Case 2. The Column B has three different References for the same Name (Column D) then Unique No. of 2001 will be set for 1001 & 1002.

Case 3. The Column B has two different References for the same Name (Column D) then Unique No. of 3001 will be set for 3003.

Case 4. The Column B has three different References for the same Name (Column D) then Unique No. of 2001 will be set for 2003 & 2009.

Case 5. The Column B has three different References for the same Name (Column D) then Unique No. of 1001 will be set for 3001 & 3003.

Please let me know how to solve this, I have attached the sample file along with Output, Some one please help me because I have very big data to modify.

patel
06-22-2013, 01:01 AM
I can not understand the criteria

Foncesa
06-22-2013, 06:36 AM
I can not understand the criteria

ok, i will explain it, the records in column D (name) are identical names which can be upto 4-5, and the Column B (reference) has different numbers alloted to it, (from here we will select priorty based) this priorty will select the unique no from column A and allocate it to others in column A for same identical names.

Like for example the Column D has 5 rows in which Foncesa is repeated
and Column B (reference) has different Nos., then it will look into column A for priorty that means if found 1001,1002,2001,2002,2003 it will get the 2001 as priorty and from column B (reference) will be alloted to all remaning 4

Please have a look to my sample workbook, and please give me an idea from where should i start.

patel
06-22-2013, 07:38 AM
I need a sample with more data , desired result with comments about used criteria

Foncesa
06-22-2013, 01:57 PM
I need a sample with more data , desired result with comments about used criteria