Match TextBox Back Color to Cell Fill Color

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

Guest

Hi,

Cell A1 fill color is Green. It is conditional formatted to turn Red for a
certain value.

Is it possible to code a TextBox Back Color on a VBA Form to turn Red also
if Cell A1 is Red?

I looked in the archives for this, but didn't find quite what I'm looking for.

Thank you for your time in reading my question.
Amy
 
Do you want this to happen when the form opens? When the value changes?

In any case you'll need something similar to the following:
If Range("A1").interior.colorindex = 3 then
textbox1.backcolor = &HFF&
end if
 
Thanks for answering my question JNW. This can happen when the form opens.
It does not have to change immediately after the value changes.
Would you insert the code under the Form1 Open procedure?
Thanks again,
Amy
 

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