![]() |
Match TextBox Back Color to Cell Fill Color
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 |
Match TextBox Back Color to Cell Fill Color
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 |
Match TextBox Back Color to Cell Fill Color
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 |
Match TextBox Back Color to Cell Fill Color
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 |
Match TextBox Back Color to Cell Fill Color
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 |
All times are GMT +1. The time now is 11:12 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com