ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lookup Cell Interior (https://www.excelbanter.com/excel-programming/442932-lookup-cell-interior.html)

Confused Slug

Lookup Cell Interior
 
I am currently using the vlookup function to find values on another sheet
('Previous Report') associated with data on the current sheet and to transfer
any matching results to the first sheet, (working with no problems).

How can i extend this so that as well as transfering any matching data the
interior color for the cell is also 'copied' over to the current sheet.


rangecheck = Range("A8")
Range("L8").Select

Do Until rangecheck = ""
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-11],'Previous Report'!C[-11]:C[-1],11,0)"
If IsError(ActiveCell) Then
ActiveCell = ""
End If
ActiveCell.Offset(1, 0).Select
rangecheck = ActiveCell.Offset(0, -11)
Loop


Don Guillett[_2_]

Lookup Cell Interior
 
Instead of a formula why not use vba FIND and copy the find
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Confused Slug" wrote in message
...
I am currently using the vlookup function to find values on another sheet
('Previous Report') associated with data on the current sheet and to
transfer
any matching results to the first sheet, (working with no problems).

How can i extend this so that as well as transfering any matching data the
interior color for the cell is also 'copied' over to the current sheet.


rangecheck = Range("A8")
Range("L8").Select

Do Until rangecheck = ""
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-11],'Previous Report'!C[-11]:C[-1],11,0)"
If IsError(ActiveCell) Then
ActiveCell = ""
End If
ActiveCell.Offset(1, 0).Select
rangecheck = ActiveCell.Offset(0, -11)
Loop




All times are GMT +1. The time now is 06:20 AM.

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