• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to highlight multiple textboxes depending on values in another textbox

Bimmy

Member
Hi,

I have 10 textboxes.

Textbox9 is linked to C8 on sheet1.

C8 is where the keywords will be entered.

If the keyword is "Complete" then macro should highlight Textbox1,2,3,4,6,7,10
If the keyword is "Inline" then macro should highlight Textbox1,2,3,5,6,7,10
If the keyword is "Progress" then macro should highlight Textbox1,2,5,6,7,10
If the keyword is "Incomplete" then macro should highlight Textbox1,5,6,7,8,10

This should happen when the command button is clicked.

The colour should be orange.

Have attached sample sheet.
 

Attachments

  • Textbox Color.xlsb
    13.9 KB · Views: 2
Hi !

A sample to complete :​
Code:
Private Sub CommandButton1_Click()
    Select Case TextBox9.Text
        Case "Complete":    VT = [{1,2,3,4,6,7,10}]
        Case "Inline":      VT = [{1,2,3,5,6,7,10}]
    End Select
    For Each V In VT
        Me.Controls("TextBox" & V).BackColor = &H80C0FF
    Next
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Back
Top