ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I return the format & value of cell with VLOOKUP ? (https://www.excelbanter.com/excel-programming/429503-how-can-i-return-format-value-cell-vlookup.html)

rickcstahl

How can I return the format & value of cell with VLOOKUP ?
 
I am using VLOOKUP to retrieve values from several different worksheets. I
also wish to retreive the cell's format (color). There are many different
colors on the worsheets based on many complex criteria. Is there anyway the
individual formats of the cells retrieved can also be returned with the
values ?

Thanks,
Rick

Don Guillett

How can I return the format & value of cell with VLOOKUP ?
 
Not with a formula


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"rickcstahl" wrote in message
...
I am using VLOOKUP to retrieve values from several different worksheets. I
also wish to retreive the cell's format (color). There are many different
colors on the worsheets based on many complex criteria. Is there anyway
the
individual formats of the cells retrieved can also be returned with the
values ?

Thanks,
Rick



Patrick Molloy

How can I return the format & value of cell with VLOOKUP ?
 
you could use MATCH() instead to return the row/column in the table, then
use a range object to get that cell's properties



"rickcstahl" wrote in message
...
I am using VLOOKUP to retrieve values from several different worksheets.
I
also wish to retreive the cell's format (color). There are many different
colors on the worsheets based on many complex criteria. Is there anyway
the
individual formats of the cells retrieved can also be returned with the
values ?

Thanks,
Rick



Patrick Molloy

How can I return the format & value of cell with VLOOKUP ?
 
i hit send too early
i was suggesting that MATCH would allow you to do this

example
so instead of
dim val as string
val = WorksheetFunction.VLOOKUP(what, where, ret, false)

dim val as Range
dim rowindex as long
rowindex = WorksheetFunction.MATCH(what, where.columns(1), false)
set val = where.resize(1,1).Cells(index,ret)






whe what is string to be found, where is the range table to be searched,
ret is the return column



"rickcstahl" wrote in message
...
I am using VLOOKUP to retrieve values from several different worksheets.
I
also wish to retreive the cell's format (color). There are many different
colors on the worsheets based on many complex criteria. Is there anyway
the
individual formats of the cells retrieved can also be returned with the
values ?

Thanks,
Rick




All times are GMT +1. The time now is 08:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com