+ Reply to Thread
Results 1 to 4 of 4

MSGBOX with structured data - OK / EXIT

  1. #1
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    MSGBOX with structured data - OK / EXIT

    I've been trying to add a msgbox that will be opened once the workbook is opened to alert a user that the they need to be authorized to use the workbook. I can get a msgbox to pop ope (workbook open), I've added the message but I have 2 issues:

    - its all in a tight paragraph and not easily to understand / read
    - cannot find a way to add OK (will continue to use the tool) or EXIT (exit the workbook)

    I want to add the following in the msgbox with that organized structure vs all wrapped up:

    Legal Mandate

    In order to view or change any data residing in this tool, you must be either –

    1. An XXX employee who for purposes of performing your XXX job functions, has a need to view or change such data in the tool.

    OR

    2. A contractor who

    a. in order to perform your XXX-assigned job functions, has a need to view such data, or
    b. is serving as a Lead Project Manager or Estimator for an XXX software development/enhancement project and,
    in order to perform your XXX-assigned job functions for such project, has a need to change data in the tool.

    Any other person should immediately exit this tool without viewing or changing any data therein.
    Last edited by rz6657; 02-28-2013 at 01:26 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: MSGBOX with structured data - OK / EXIT

    rz6657,

    Using Buttons:=vbOkCancel will put an OK and Cancel button on the msgbox. Then set a variable equal to the msgbox and it will be assigned a value depending on which button the user clicks. Afterwards, you can use the assigned value of the variable to perform an action based on what the user clicked. For example:
    Please Login or Register  to view this content.


    However, if you need something more "structured" than this, I would have to recommend that you create a userform instead of using a msgbox.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: MSGBOX with structured data - OK / EXIT

    For something like that I would create a Form and just type everything in a text box or two that you want to pop up. Then add two buttons at the bottom and the code can be like this.

    Please Login or Register  to view this content.
    edit: I like Tiger's answer better. I didn't know about the character 10 for the new line.

  4. #4
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: MSGBOX with structured data - OK / EXIT

    Tiger, that worked perfectly. Thanks for your help. Thanks for your feedback as well Hawkeye...

+ 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