get values and colors back in a cell

C

Cheetahke

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?
 
B

Bill Renaud

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).
 

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