Excel functions or VBA solution needed: Beginner!

hoochy

New Member
Joined
May 24, 2016
Messages
2
Hey Guys!

Can someone please help me?

I am trying to allocate an ID number (contained in another worksheet) to every unique name in column A. At the moment, The ID numbers of all “Dog Kennels” are the same but they should be different as they reside in different departments. However, I only want to run the solution when there are at least two consecutive similar names. Please refer to the example below:

Column A= Names
Column B= identification number
A B
C
Cat Kennels Aus 789
Dog Kennels – VIC 123 Address 1
Dog Kennels – NSW 123 Address 1
DOG Kennels – QLD 123 Address 1
Rat Cages 321

So the Dog Kennels in VIC, NSW and QLD should all have unique ID's and addresses which are randomly contained in another worksheet but the Cat Kennels and Rat Cages should be left untouched.

I want to run this solution in multiple sheets and each sheet has thousands of rows.

Please let me know if you need more information :)

Hoochy
Experience Level = Beginner
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hey Guys!

Can someone please help me?

I am trying to allocate an ID number (contained in another worksheet) to every unique name in column A. At the moment, The ID numbers of all “Dog Kennels” are the same but they should be different as they reside in different departments. However, I only want to run the solution when there are at least two consecutive similar names. Please refer to the example below:

Column A= Names
Column B= identification number
A B
C
Cat Kennels Aus 789
Dog Kennels – VIC 123 Address 1
Dog Kennels – NSW 123 Address 1
DOG Kennels – QLD 123 Address 1
Rat Cages 321

So the Dog Kennels in VIC, NSW and QLD should all have unique ID's and addresses which are randomly contained in another worksheet but the Cat Kennels and Rat Cages should be left untouched.

I want to run this solution in multiple sheets and each sheet has thousands of rows.

Please let me know if you need more information :)

Hoochy
Experience Level = Beginner

I'm sure there's some VBA code that would help you. Some conditional assumptions:
Assuming that all the following apply then:
1) The data you supplied is in a single sheet;
2) The data doesn't migrate all over the sheet randomly;
3) The data is a contiguous range;
4) There is a definite pattern to the data;
... then yes, it's possible.
 
Upvote 0
Hi Rhodie,

the answer is yes on all counts of assumptions.
Are you able to give me some quick advice on what the code should look like?

Thanks in advance!

Hoochy
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top