ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   get values and colors back in a cell (https://www.excelbanter.com/excel-programming/400984-get-values-colors-back-cell.html)

Cheetahke

get values and colors back in a cell
 
Is it possible to get the value, the formula, the color inside, and the font
color once they are changed in Worksheet_change?
I have in a cell a formula that searches for a certain value on another
worksheet.
When I open the workbook, those values get a specific color (font and
interior).
In the row beneath, I can enter another value. Then the cell above get that
value and the specific color for that new value.
Now I'm searching for a way that, when I remove the last entered value, the
cell above gets the old value (by formula) and the colors need to be set for
that specific value.
Ex:
A B C
1 3 3 3 <-- before changing: color = black,
interior = yellow
2

1 3 3 2 <-- after changing: color = blue,
interior = red
2 2 <-- cell with inputs: color = blue,
interior = red

When I delete the 2 (in row 2 - column C), I like to have the "3" back with
the colors black as font and yellow as interior.

Anyone any idea?

Bill Renaud

get values and colors back in a cell
 
Use code like the following in your Worksheet_Change event handler to refer
to the cell above the Target cell:

Dim rngCellAbove as Range

Set rngCellAbove = Target.Offset(-1,0)

.... then do whatever you want with rngCellAbove.

In similar fashion, the cell below would be Target.Offset(1,0).

--
Regards,
Bill Renaud





All times are GMT +1. The time now is 07:37 PM.

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