VBA for vlookup that returns source formatting

climbingchillie

New Member
Joined
May 22, 2018
Messages
1
Hi

I'm a complete newbie to VBA and struggling to find a google answer that fits my specific needs and lack of knowledge.

I have 2 workbooks; One called 'Master' that contains a unique code in column A and a long text description with bold, coloured text and colour shading (not conditional, specific to each individual cell) in column B

The second workbook, "Audit", has the unique references in column B and i'd like to run the formula/return the result in column D.

Based on the unique reference in column A of "Master" matching column B in Audit i'd like to return the values of column B in Master including all formatting to column D in Audit.

Any help is greatly appreciated!

Master Example
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]GLA 2015/11[/TD]
[TD]Does the client drive goods vehicles over 3.5 tonnes in London?


If so, are they fitted with:
(i) a class V mirror on the passenger side
(ii) a class VI mirror to the front of the vehicle and
(iii) sideguard
[/TD]
[/TR]
</tbody>[/TABLE]


Audit example
[TABLE="width: 500"]
<tbody>[TR]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Reference[/TD]
[TD]Title[/TD]
[TD]Audit Questions[/TD]
[/TR]
[TR]
[TD]GLA 2015/11[/TD]
[TD][TABLE="width: 285"]
<tbody>[TR]
[TD="class: xl70, width: 285"]The GLA Roads and GLA Side Roads (London Safer Lorry Scheme) (Restriction of Goods Vehicles) Traffic Order 2015 (GLA 2015/11)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]FORMATTED RESULT HERE[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,022
Latest member
RobertV1609

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