Search and copy the corresponding value from duplicate values into the adjacent cell

I need your help please in the attached sample file ( original file with data over 100,000 rows)
Column A has many duplicate values and in column S the value is corresponding to this value but its enter only in one cell.
What I want is to copy the value mentioned in column S in front of all corresponding value in column A.
 I hope this clear
M. SaadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

attached sample file
File missing
M. SaadAuthor Commented:
sorry, i have attached the sample
copy the value mentioned in column S in front of all corresponding
Prepend the S column value to the text in the A column values?

Open in new window

Or create a new column A with the column S values?
New Column A       	Col.1
SMGFB-JS-PM-T-00102	A00-GA-E-0060012
SMGFB-JS-PM-T-00102	A00-GA-E-0060012
SMGFB-JS-PM-T-00102	A00-GA-E-0060012
SMGFB-JS-PM-T-00102	A00-GA-E-0060012

Open in new window

or something else?

These two columns don't seem to share any common data.  Are they 'related' by the color coding?

What should happen when there is NO column S data?  An example of this condition is in rows 53-60.
Price Your IT Services for Profit

Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.

M. SaadAuthor Commented:
thanks for your concern, please note that

1- color has nothing to do with the data
2- " What should happen when there is NO column S data?  An example of this condition is in rows 53-60." ... nothing should be in the column S.
3 - example for document no from column A " A00-GA-E-0060012" this number start from rows 21-29 but the number "SMGFB-JS-PM-T-00102" is available on row no 26 only.
so i want the code or formula to search for all duplicate no in column A and then search for the value available in column S and then copy this value in the other empty cells in same column S ( so the result will be SMGFB-JS-PM-T-00102 available in all rows from 21-29.)

as you can see in the attached photo , the number highlighted in red is the original input, and the black numbers is what i need to do automatically
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Please give this a try...
Sub PopulateColumnS()
Dim ws As Worksheet
Dim lr As Long, i As Long
Dim x, y(), dict

Application.ScreenUpdating = False

Set ws = Sheets("Sheet1")
lr = ws.Cells(Rows.Count, 1).End(xlUp).Row
x = ws.Range("A21:S" & lr).Value
ReDim y(1 To UBound(x, 1), 1 To 1)
Set dict = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(x, 1)
    If x(i, 19) <> "" Then dict.Item(x(i, 1)) = x(i, 19)
Next i
On Error Resume Next
For i = 1 To UBound(x, 1)
    y(i, 1) = dict.Item(x(i, 1))
Next i
ws.Range("S21").Resize(UBound(y), 1).Value = y
Application.ScreenUpdating = True
End Sub

Open in new window

In the attached, click the button called "Populate Column S" on Sheet1 to run the code.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
M. SaadAuthor Commented:
dear Mr. Neeraj
many thanks for your support
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome!
Posting an example of what you needed was very helpful.  It would have saved time and clarification questions.

Kudos to Neeraj for an efficient solution.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Thanks aikimark!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.