Results 1 to 3 of 3

Thread: Userform to hide after x number of seconds
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Dec 2012
    Posts
    170
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Userform to hide after x number of seconds

    Hi,
    I'm trying to create a "tour" so to speak in excel for the latest updates to a spreadsheet.

    I have the text wrote in a userform, and then I was the userform to be displayed for around 3 seconds for people to read it before the macro continues to the next stage.

    However, I seem to have to manually close the userform before it goes to the next stage.

    Here is the macro I have written

    Code:
    Sub sample()
    With zScript
        .Label1 = "An option has been added to allow you to enable automated handoff emails."
        .Show
    End With
    Application.Wait (Now + TimeValue("0:00:03"))
    zScript.Hide
    With Sheets("Home").CheckBox21
        .BackColor = &HFF&
        .ForeColor = &HFFFFFF
    End With
    Application.Wait (Now + TimeValue("0:00:02"))
    With zScript
        .Label1 = "To enable automated emails, please tick the box."
        .Show
    End With
    Application.Wait (Now + TimeValue("0:00:02"))
    zScript.Hide
    With Sheets("Home").CheckBox21
        .BackColor = &HFFFFFF
        .ForeColor = &HFF&
    End With
    End Sub
    I want
    1. Message to appear
    2. Close after 3 seconds
    3. Check box to change colour to highlight it
    4. New message to appear 2 seconds later
    5. That message to then close after a further 2 seconds
    6. Then the check box to change back to the original colour

    Regards

  2. #2
    Board Regular
    Join Date
    Dec 2012
    Posts
    170
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Userform to hide after x number of seconds

    Fixed it.

    Put the delay into the userform rather than the subroutine

  3. #3
    Board Regular
    Join Date
    Jul 2002
    Location
    Derbyshire, UK
    Posts
    1,605
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Userform to hide after x number of seconds

    Look for examples of Splash Screens like this
    Hope that helps.

    Free Excel sample DataBase Form here

    royUk's web site

    "making Excel work for you"

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •