Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Keep text color

Hi All,

How can I get a Userform textbox to display the different color text in a
cell it references.

Thank you


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Keep text color

You're writing skills are not very clear. It isn't clear whether
the text box should take the color of the cell or the cell should
take the color of the text box.
If you want the text box to take the color of a cell, use

Private Sub UserForm_Initialize()
Me.TextBox1.BackColor = Range("A1").Interior.Color
End Sub

If you want the cell to take the color of the text box, use

Range("A1").Interior.Color = Me.TextBox1.BackColor


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"LookingGood" wrote in
message
...
Hi All,

How can I get a Userform textbox to display the different color
text in a
cell it references.

Thank you




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Keep text color

Chip,

I have a cell that has 2 lines of data. The first line is red and the second
is blue.

In my userform the textbox references this cell. I would like the text to be
displayed as it appears in the cell.

Can this be achieved.....


"Chip Pearson" wrote:

You're writing skills are not very clear. It isn't clear whether
the text box should take the color of the cell or the cell should
take the color of the text box.
If you want the text box to take the color of a cell, use

Private Sub UserForm_Initialize()
Me.TextBox1.BackColor = Range("A1").Interior.Color
End Sub

If you want the cell to take the color of the text box, use

Range("A1").Interior.Color = Me.TextBox1.BackColor


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"LookingGood" wrote in
message
...
Hi All,

How can I get a Userform textbox to display the different color
text in a
cell it references.

Thank you





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
How do I fill one cell color with text html/rgb color from another thewris Excel Discussion (Misc queries) 2 January 22nd 09 12:24 AM
Can't format cell color/text color in Office Excel 2003 in fil Tony S Excel Discussion (Misc queries) 1 December 21st 07 01:41 PM
Make text color match cell color with macro? JoeSpareBedroom Excel Discussion (Misc queries) 1 June 26th 07 07:09 PM
Cond. format text color based on another's text color manxman Excel Discussion (Misc queries) 3 August 31st 06 06:27 PM
Can't format cell color/text color in Office Excel 2003 in files . albertaman Excel Discussion (Misc queries) 0 February 16th 06 03:56 AM


All times are GMT +1. The time now is 02:00 AM.

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"