Fill Cells using a reference Text and Column/Rows

ndikum

New Member
Joined
Aug 6, 2013
Messages
6
Hello,

I am trying a do cell replacement exercise and have found it a bit challenging. Below is my data and expected results:

Current Data:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Policy No[/TD]
[TD]Name_Address[/TD]
[TD]Agent[/TD]
[TD]Code[/TD]
[TD]Date[/TD]
[TD]Premium[/TD]
[/TR]
[TR]
[TD]23456[/TD]
[TD]James Price[/TD]
[TD]T83P[/TD]
[TD]2XP[/TD]
[TD]23/05/2013[/TD]
[TD]£35.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]PO1 2TN[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8990[/TD]
[TD]As Above[/TD]
[TD]S9TU[/TD]
[TD]VT1[/TD]
[TD]15/07/2013[/TD]
[TD]£25.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]














Expected Result:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Policy No[/TD]
[TD]Name_Address[/TD]
[TD]Agent[/TD]
[TD]Code[/TD]
[TD]Date[/TD]
[TD]Premium[/TD]
[/TR]
[TR]
[TD]23456[/TD]
[TD]James Price[/TD]
[TD]T83P[/TD]
[TD]2XP[/TD]
[TD]23/05/2013[/TD]
[TD]£35.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]PO1 2TN[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8990[/TD]
[TD]James Price[/TD]
[TD]S9TU[/TD]
[TD]VT1[/TD]
[TD]15/07/2013[/TD]
[TD]£25.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Line3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]PO1 2TN[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

So the idea is just replace the “Name_Address” column with the results indicated by the text "As Above" and sure it fields the required number of rows.

Take into consider cases where we might have more than 3 lines of the address (variables) i.e. Line1, Line2, Line3, Line4.

I will appreciate if someone can put in the right direction or provide a full-blown solution.

Regards,

Terry
 
This data looks familiar :D. I think it might be better to peform this task on the data, after it has gone through the routine that was written for you earlier. Just a thought.
 
Upvote 0

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