VLookup and cell shading

S

Sherry

I am pulling in data using a Vlookup and would like for it to keep the same
cell color shading as in the original spreadsheet that it is pulling from.
Is this possible?
 
P

Pete_UK

No, a formula can not be used to convey formatting information, only values.

If the cell shading is applied through conditional formatting, though, the
same conditional formatting could be applied to the cell with the VLOOKUP
formula in, to achieve the same effect.

Pete
 
M

mvk

Yes! But you would need to use VBA. You first need to identify the address
of the cell with the value that was chosen, and then use VBA to return the
format of this cell and then apply that format to the new cell.

To do the first bit you could add a column which holds the row number, you
know the column letter and you can now make a reference to the cell.

Hope this helps, if not happy to go into more detail.

MVK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top