Excel VB Script to Fill Values Based on Common Values in an Adjacent Cell

RobertN

New Member
Joined
Jan 10, 2020
Messages
27
Office Version
  1. 365
Platform
  1. Windows
  2. Web
I have a spreadsheet with a value in column B, a corresponding value in column I, and [needing] the word "Duplicate" in column J for all rows (except the first instance) where the value in column B is repeated.

I am looking for a VB script that will:
  • Add the word "Duplicate" in column J for all records (except the first instance) where the corresponding value in column B is duplicated.
  • If there is a value in column I for any one of the [duplicate] instances of column B, than copy that I value into column I for all instances.
  • If any instances of the value in column B has a different I value, then highlight the cells in column I for all instances.
See the attached example. Thanks for your help.
 

Attachments

  • Example.png
    Example.png
    22.4 KB · Views: 9

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,552
Messages
6,120,172
Members
448,948
Latest member
spamiki

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