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

Thread: mesage box yes or no

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi-
    Im using a mesage box on userform1 that pops up when the user presses the commandbutton. The mesage box asks a question, then gives a choice of yes or no. If yes is selected I want userform1.hide and userform2.show. if no is selected I want userform1.hide and userform3.show. How do you write this in code in the userform1 commandbutton click()?

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-02 07:37, Todd_M wrote:
    Hi-
    Im using a mesage box on userform1 that pops up when the user presses the commandbutton. The mesage box asks a question, then gives a choice of yes or no. If yes is selected I want userform1.hide and userform2.show. if no is selected I want userform1.hide and userform3.show. How do you write this in code in the userform1 commandbutton click()?
    dim Ans as string
    Ans = msgbox("your Q",Vbyesno)
    if Ans = vbyes then
    userform1.hide
    userform2.show
    else
    userform1.hide
    userform3.show
    endif


    Ivan

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Ivan- this works great

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
  •