Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox backgroundcolor
for my application i created a form with a textbox on it. With a code the
value of the searched cell will be displayed in the textbox. However i also want the textbox.backgroundcolor to be the same as the cell color. So something like TextBox1.backgroundcolor = ActiveCell.interior.Colorindex. Problem is that excel uses the colorindex 3 for the color red, and visual basic uses &H000000FF& for that same color. Is there a way so that i can create this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox backgroundcolor
TextBox1.BackColor = ActiveCell.Interior.Color
In passing - myColorIndex = 3 myLongRGB = ActiveWorkbook.Colors(myColorIndex) Regards, Peter T "Frank M" wrote in message ... for my application i created a form with a textbox on it. With a code the value of the searched cell will be displayed in the textbox. However i also want the textbox.backgroundcolor to be the same as the cell color. So something like TextBox1.backgroundcolor = ActiveCell.interior.Colorindex. Problem is that excel uses the colorindex 3 for the color red, and visual basic uses &H000000FF& for that same color. Is there a way so that i can create this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox backgroundcolor
Use color instead of colorindex. the code below returns 255 for the variable
a. Range("A1").Interior.ColorIndex = 3 a = Range("A1").Interior.Color "Frank M" wrote: for my application i created a form with a textbox on it. With a code the value of the searched cell will be displayed in the textbox. However i also want the textbox.backgroundcolor to be the same as the cell color. So something like TextBox1.backgroundcolor = ActiveCell.interior.Colorindex. Problem is that excel uses the colorindex 3 for the color red, and visual basic uses &H000000FF& for that same color. Is there a way so that i can create this? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox backgroundcolor
Thnx, it works great!
"Joel" wrote: Use color instead of colorindex. the code below returns 255 for the variable a. Range("A1").Interior.ColorIndex = 3 a = Range("A1").Interior.Color "Frank M" wrote: for my application i created a form with a textbox on it. With a code the value of the searched cell will be displayed in the textbox. However i also want the textbox.backgroundcolor to be the same as the cell color. So something like TextBox1.backgroundcolor = ActiveCell.interior.Colorindex. Problem is that excel uses the colorindex 3 for the color red, and visual basic uses &H000000FF& for that same color. Is there a way so that i can create this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
cell backgroundcolor | Excel Programming | |||
Change backgroundcolor | Excel Discussion (Misc queries) | |||
Assigning backgroundcolor to button on form | Excel Programming | |||
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys | Excel Programming | |||
Textbox Bug? Missing/delayed update of textbox filled via VBA | Excel Programming |