Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Changing color in text boxes based on content
I have a spreadsheet with multiple cells and text boxes in some of the cells.
I want to be able to change the internal format of the cell based on the information contained in the text box using a macro. Also, is there a way to wrap the text box around the data in the cell like the way Word can? Any assistance would be appreciated. oldybutgoody |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Changing color in text boxes based on content
One way:
Public Sub CFTextBox1() Dim nColorIndex As Long Select Case Sheets("Sheet1").TextBoxes("Text Box 1").Text Case "Option 1" nColorIndex = 3 Case "Option 2" nColorIndex = 5 Case "Option 3" nColorIndex = 7 Case Else nColorIndex = xlColorIndexNone End Select Range("A1").Interior.ColorIndex = nColorIndex End Sub Expand/change format to suit. Your text boxes aren't "in some of the cells". Text boxes always exist in the Drawing Layer in front of the cells. At best they can be positioned to move and size with the underlying cells. XL can't wrap text around them. In article , oldybutgoody wrote: I have a spreadsheet with multiple cells and text boxes in some of the cells. I want to be able to change the internal format of the cell based on the information contained in the text box using a macro. Also, is there a way to wrap the text box around the data in the cell like the way Word can? Any assistance would be appreciated. oldybutgoody |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to change a cell color based on its content using macro? | New Users to Excel | |||
Cond. format text color based on another's text color | Excel Discussion (Misc queries) | |||
Changing background color based on different cell | Excel Discussion (Misc queries) | |||
Changing color of single bar based on x-axis date value | Charts and Charting in Excel | |||
Changing the color of a list entry based on a tolerance | Excel Worksheet Functions |