Change color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good day,

I don't know if this is possible in Excel, but I would like to change the
background color of a cell as soon as it has been typed in. Is this even
possible?
 
Try this,

Public OldRng As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not OldRng Is Nothing Then
OldRng.Interior.ColorIndex = 35 'Awful green, change to taste
If OldRng.Value = "" Then OldRng.Interior.ColorIndex = xlNone
End If
Set OldRng = Target
End Sub

Right click the sheet tab, view code and paste in.

Mike
 
Thanks Mike! It worked, however, because I have inserted formulas throughout
the spreadsheet, I only really wanted it to change color when I typed over
any given formula. This is probably not possible, but I appreciate your
response, thanks again!
 
I'm glad it helped and had you asked for formula then that is doable.
However, before I try I'm nervous about

when I typed over
any given formula

Is this different than any formula?

Mike
 
No...just me being strange...I have a vlookup formula in every cell and when
I type over the formula even if it results in the same value as the formula,
I wanted the cell to change...this is my struggle...I can change the colour
with the conditional format cell value does not equal to, however, if I
actually want the same value manually typed in as the formula would result
in, I would still like to see that it has been type in...too much info I
know. Thanks again Mike! You've been awesome!
 

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

Back
Top