Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
make all cells in same row match cell formatted with fill color zjopa Excel Discussion (Misc queries) 2 May 21st 08 04:26 AM
Make text color match cell color with macro? JoeSpareBedroom Excel Discussion (Misc queries) 1 June 26th 07 07:09 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
Cell fill color. Row to match specific cell. CADinDallas Excel Programming 3 January 4th 06 01:00 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM


All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"