Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 154
Default lookup format

Rach,

The best that I could dally up was the return the number formatting of a
VLookup, not necessarily the borders/fill/text color.

This would require you to add a User Defined Function to your document.
Press Alt+F11InsertModule. In the module add:

Function GetFormat(Cell as Range) as String
GetFormat = cell.NumberFormat
End Function

and for your Vlookup, you will need to add:

=TEXT(VLOOKUP(<Cell,<Array,<Column,<T/F),GetFormat(<Cell))

So, if B1 is the value you wish to return, from array A1:B4, lookup on C1,
then:

=TEXT(VLOOKUP(C1,$A$1:$B$4,2,FALSE),GetFormat(B1))

--
--Thomas [PBD]
Working hard to make working easy.


"Rach" wrote:

Hi

I'm doing a vlookup but i also want to maintain the formatting of the cell
that has the data that im looking up e.g. highlighted in blue.

Is there a way to do this?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional format lookup Johnny1r Excel Worksheet Functions 2 March 12th 08 03:58 AM
Lookup a value when the range contains a high - low format rpalarea Excel Discussion (Misc queries) 3 August 7th 07 04:59 PM
lookup function, returning the same format. lookup function, returning the same form Excel Worksheet Functions 1 November 2nd 06 03:29 AM
using lookup to return more than one answer in date format Geni Slaughter Excel Worksheet Functions 4 November 28th 05 06:34 PM
Need help with lookup on text format Krista Excel Worksheet Functions 8 September 8th 05 08:02 PM


All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"