Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I would like to dynamically change the background color in an array of TextBoxes in a Form, based on background colors in corresponding cells on the sheet. The textboxes are named so that they can be adressed but how do i typecast a recieved Control from the Controls collection to a TextBox control (I get type mismatch errors) and how do I set the BackColor-property ? I would be greatful for advices on this matter! // Sample pseudo-code below Best regards, StefanW Private Sub SetBackgnd() Dim tb As TextBox Dim x, y As Integer For y = 1 To 13 For x = 1 To 3 Set tb = MyForm.Controls("row" & y & "col" & x) <- I get error here 'Change background color of TextBox named "row'y'col'x'" 'based on backgroundcolor in Range("A1").Offset(row,col) Next res Next mt End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change tab color based on current color of a cell | Excel Discussion (Misc queries) | |||
Can you change the color of one cell based on the color of another | Excel Discussion (Misc queries) | |||
Excel: Syntax to change cell color based on color of another cell | Excel Worksheet Functions | |||
Change tab color based on a cell value | Excel Discussion (Misc queries) | |||
Q: How to change tab color based on cell value | Excel Programming |