• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

vba assign a value against a cell as many times as value in the cell

Hi Everyone,

I have below query..

I have two columns...in first column I have few names...some of them are unique however few of them are multiple times....Now I want to assign a code (let's say abc, agg) in the second column against each name....now the problem is here....if I have a unique name I can assign a code 1 time....but if I have a name in the column 3 times....I am not able to assign the same code 3 times against that name...

Please help
Thanks and Regards,
Sandy
 
Hi ,

How are you assigning codes to names ?

Why are you not able to assign the same code multiple times ?

If you can upload a workbook with data in it , things will become clearer.

Narayan
 
Hi Narayank,

Thanks for initiating..

Following is the table....I need to update second column on the bais of first column...In the following example I have same Name in first 3 rows hence those first three rows needs to be assign to same agent, in this case it is Ajay,....then I have same name 2 times....hence I want to assign those 2 lines to 1 agent which is Rohan this case...Inputs for agent names is taking from a userform....I have a userform where I have multiple text boxes...each text box is on the name of a agent....when userform appears I put a number in any random text box.....and it assigns those many lines to that agent....one row after another....Problem exists when I have same name in one columns (I have sorted the column)...so if I have same name in 3 rows...it should be assigned to same agent...So if I enter 2 in first text box which is on the name of Ajay....it should consdering 3 names (Sharma, Sandeep) as 1 and next 2 names(Sharma, Anil)as 1 hence from B2 to B6 it should take Ajay only...Hope it clarifies....

Name agent Duplicate names
Sharma, Sandeep 012317 Ajay 3
Sharma, Sandeep 012317 Ajay 3
Sharma, Sandeep 012317 Ajay 3
Sharma, Anil 012317 Rohan 2
Sharma, Anil 012317 Rohan 2
Sharma, Komal 012317 Mohit 1
 
Last edited:
Hi ,

Please upload a workbook with all that you have already developed , data , userform , code ,...

That will help members to get a better idea of what can be done to help you.

Narayan
 
Back
Top