+ Reply to Thread
Results 1 to 11 of 11

any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

  1. #1
    Registered User
    Join Date
    05-30-2010
    Location
    hk
    MS-Off Ver
    Excel 2003
    Posts
    17

    any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    I am writing a program to run a couple of loops until the user select "NO' when prompted by a msgbox.

    however, my problem is that whenever the msgbox pops out, the user cannnot scroll/ move around the worksheet which refrained the user from making a informed decision. The user must made allowed to see the whole big worksheet before he/she chose whether to move on or not.


    So my question is as titled.
    any way to scroll/move around the worksheet when a msgbox prompts for a vbyesno choice??

    thankssssssssss very much.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    Hello christheta,

    The system message boxes are designed to force the user to answer before interacting with the application program (modal operation). You can workaround the problem by creating a VBA UserForm and setting its ShowModal property to False.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-30-2010
    Location
    hk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    Dear Leith

    I am not sure if I fully understand what you mean by creating a userform. Can you please further elaborate on this?

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    Good morning christheta

    Go to the VBE and go to Insert > Userform and build a userform from there.

    Have a look at the attached example file to see what Leith means about the vbModeless property.

    HTH

    DominicB
    Attached Files Attached Files
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Registered User
    Join Date
    05-30-2010
    Location
    hk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    thanks a lot for the illustration

    Since I am new to the Userform function.
    anyway I can embed the VByesno in the userform?

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    Hi christheta
    Quote Originally Posted by christheta View Post
    anyway I can embed the VByesno in the userform?
    No. You will have to add two buttons to the userform, then from the userform design screen double click one of the buttons. It will take you to the code module for that button. Just put your code in for your yes or no choices (whatever it is that you are asking). Make sure you put the code in for both buttons.

    HTH

    DominicB

  7. #7
    Registered User
    Join Date
    05-30-2010
    Location
    hk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    cos i am actually running a loop that will go on and on until vbyes..
    so if I use the userform for this purpose. what should I do.

    any example for this?

    thanks!

  8. #8
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    Hi christheta

    Could you post the code you had before which utilised a MsgBox?

    DominicB

  9. #9
    Registered User
    Join Date
    05-30-2010
    Location
    hk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    sure. it's just a pretty easy one.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-30-2010
    Location
    hk
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    anyone out there?

  11. #11
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: any way to scroll around the worksheet when a msgbox prompts for a vbyesno choice

    If you use an InputBox, instead of a MsgBox, and ignore the text entry, paying attention only to the OK/Cancel buttons, the user can scroll about the sheet while deciding whether to press OK or Cancel.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1