blinking different color in label on userform

  • hi

    i need advising how i can blink in label directly when i open userform it based on the label ="Textbox Cannot be blank...." it loop for 10 time and change color as what is in my code i try but it doesn't success

  • Blinking colours is a most annoying thing to see. I would just use this


    Code
    Private Sub CommandButton1_Click()
    If Me.TextBox1.Value = Empty Then
    Me.TextBox1.BackColor = RGB(255, 0, 0)
    Me.Label1.Caption = "Textbox Cannot be blank...."
    Else: Me.TextBox1.BackColor = RGB(255, 255, 255)
    End If
    End Sub
  • you seem don't understand me first of all i search way to display blink without any command button only directly when i open the user form the second when i meant the blinking it supposes doing that for long time red then green and white ....etc for 10 seconds by time or loop

    if is possible

  • your code it gives me color of red and stop textbox but i would the label when i press command button but my code color red ,green,white for second every color continuously and i'm asking if possible that in specific event of userform like active or initialize but all of these not success

  • This sould more or less do what you want, maybe test on a copy of your work forst and add this code to the UserForm module code, add a command button1


  • thanks jack i appreciate your code works very well but i would if is directly when i open userform without command button i try getting in event of UserForm_Activate but it doesn't success it doesn't move any color like command button to understand why i do that this simple file to apply another file the idea i have data contains paying customers for specific due of date when i search specific data for customer it gives me the due of date in textbox and blink color like notification without press command button that's why i would that without command button i hope find way to do that

  • This should cover what you want, again test in a copy of your work or a new spreadsheet just in case


    This gives the best of 'all' worrlds. Not the greatest code but should be robust and work ok


    jiuk


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!