Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- JNW "AMY Z." wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "JNW" wrote: 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 -- JNW "AMY Z." wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Double-click on the for in VBA and put the code under the UserForm_Initialize
procedure. -- JNW "AMY Z." wrote: 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 "JNW" wrote: 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 -- JNW "AMY Z." wrote: 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks JNW it works!
Amy "JNW" wrote: Double-click on the for in VBA and put the code under the UserForm_Initialize procedure. -- JNW "AMY Z." wrote: 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 "JNW" wrote: 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 -- JNW "AMY Z." wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
make all cells in same row match cell formatted with fill color | Excel Discussion (Misc queries) | |||
Make text color match cell color with macro? | Excel Discussion (Misc queries) | |||
change fill color of a range of cells based on color of a cell? | Excel Programming | |||
Cell fill color. Row to match specific cell. | Excel Programming | |||
Browse Forms Controls and change TextBox color based on cell color | Excel Programming |