Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 9 of 9

Thread: once only msgbox

  1. #1
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Im wanting to have a msgbox popup only once kinda like a welcome to the new prog msgbox then thats it , does anyone have any code for that I would think it would include some vbediting from within the startup macro


    any ideas??

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Huntington Beach, CA USA
    Posts
    327
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    If i understand you requset it sounds like a
    "splash screen" Try this:

    'Create a UserForm, with your "welcome" then

    Private Sub Workbook UserForm_Activate()
    Application.OnTime + TimeValue("00.00.02"), _
    "KillTheForm"

    'This will show for 2 seconds, modify as needed.

    James

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    no I want it to appear once and once only then after that when the workbook is opened the msgbox doesn't open again

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You could place a switch in some unused cell.
    For ex.

    Private Sub Workbook_Open()
    If Sheet1.Range("IV10000").Value = 0 Then
    MsgBox "Hi! I hope you like my workbook"
    Sheet1.Range("IV10000").Value = 1
    End If
    End Sub

    Since the cell value now equals 1, assuming the workbook is saved, the messagbox will never show again...
    Tom

  5. #5
    Board Regular
    Join Date
    Jan 2005
    Posts
    146
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    James I could not get you code to work

    Wayne

  6. #6
    New Member
    Join Date
    Jan 2005
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    James is right you need a splash screen

    First you create a userform and you place this in the back

    Private Sub UserForm_Activate()
    Application.OnTime Now + TimeValue("00:00:05"), "KillTheForm"

    End Sub


    Then you place this in this workbook

    Private Sub Workbook_Open()
    UserForm1.Show
    End Sub

    Finally add a module and place

    Private Sub KillTheForm()
    Unload UserForm1
    End Sub

    Should work find

    cheers
    luc

  7. #7
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling, Scotland
    Posts
    74,007
    Post Thanks / Like
    Mentioned
    27 Post(s)
    Tagged
    2 Thread(s)

    Default

    luc

    Wayne doesn't want a form appearing every time the workbook is opened.

    He wants it to only appear the 1st time it is opened and never again.

    The code posted by Tom should work. It should go in the workbook module.
    If posting code please use code tags.

  8. #8
    New Member
    Join Date
    Jan 2005
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Norie....I guess your right

    Cheers
    luc

  9. #9
    Board Regular
    Join Date
    Jan 2005
    Posts
    146
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi guys

    I was looking for

    Splash and one with a tick box to kill once ticked but this option could be reborn with a short command

    Mastermaind it, full of ideas me,... LOL

    don't know what you think, sorry I was not thinkin along the same lines may be because I'm a newbie ;-(

    Can't you plug me in so I can download it...

    That the futurre

    TO BE MIND FULL He he

    To much matrix hey guys

    Many thanks Wayne

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
  •