Banner

Sunday, May 21, 2017

Label Width And Backcolor And Caption Change By Textbox Userform Excell VBA



Private Sub TextBox1_Change()
a = Len(Me.TextBox1.Text)
If a <= 12 Then
Me.Label1.Width = a * 19
If a <= 4 Then
Me.Label1.BackColor = vbRed
Me.Label1.Caption = "Weak"
ElseIf a <= 8 Then
Me.Label1.BackColor = vbYellow
Me.Label1.Caption = "Good"
Else
Me.Label1.Caption = "Excellent"
Me.Label1.BackColor = vbGreen
End If
End If
End Sub

No comments:

Post a Comment

Please do not enter any spam message in comment box