The text boxes - color ID by Type
The Scenario:
Multiple Text Boxes, all with an identical preselected shape
Each Text box displays a cell-referenced Letter value (A, B, C, etc.)
The project sheet has 600 of these shaped text boxes
Each letter value is assigned a specific color for the backcolor
Currently the backcolor is manually changed based on the letter value, one text box at a time
I attempted to do this backcolor change automatically using the Assign Macro Option (select text box, right click, select Assign Macro)
Here is the Code I generated, and the error message:
________________________________________________________________________________________________
Sub AutoShape3_Click()
Private Sub AutoShape3_Change()
Select Case AutoShape3.Value
Case "A": AutoShape3.BackColor = RGB(255, 0, 0)
Case "B": AutoShape3.BackColor = RGB(0, 255, 0)
Case "C": AutoShape3.BackColor = RGB(0, 0, 255)
Case Else: AutoShape3.BackColor = RGB(0, 0, 0)
End Select
End Sub
______________________________________________________________________________________________________________________________
Error Message:
Compile Error: Expected End Sub (with the top line yellow-highlighted)
Any suggestions?
A small sample file is attached.
The Scenario:
Multiple Text Boxes, all with an identical preselected shape
Each Text box displays a cell-referenced Letter value (A, B, C, etc.)
The project sheet has 600 of these shaped text boxes
Each letter value is assigned a specific color for the backcolor
Currently the backcolor is manually changed based on the letter value, one text box at a time
I attempted to do this backcolor change automatically using the Assign Macro Option (select text box, right click, select Assign Macro)
Here is the Code I generated, and the error message:
________________________________________________________________________________________________
Sub AutoShape3_Click()
Private Sub AutoShape3_Change()
Select Case AutoShape3.Value
Case "A": AutoShape3.BackColor = RGB(255, 0, 0)
Case "B": AutoShape3.BackColor = RGB(0, 255, 0)
Case "C": AutoShape3.BackColor = RGB(0, 0, 255)
Case Else: AutoShape3.BackColor = RGB(0, 0, 0)
End Select
End Sub
______________________________________________________________________________________________________________________________
Error Message:
Compile Error: Expected End Sub (with the top line yellow-highlighted)
Any suggestions?
A small sample file is attached.