Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
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
cell backgroundcolor Starting vba programmer Excel Programming 3 December 19th 05 10:18 AM
Change backgroundcolor wborg Excel Discussion (Misc queries) 2 December 1st 05 02:13 AM
Assigning backgroundcolor to button on form Brotha lee Excel Programming 2 May 20th 05 09:55 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM


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

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

About Us

"It's about Microsoft Excel"