Consulting

Results 1 to 4 of 4

Thread: Msgbox and Functions

  1. #1

    Msgbox and Functions

    I have 2 questions.

    1) Is there a way to add buttons and chang the display name of them to a messagebox? Is so is there a way to add multiple "custom named" buttons to a messagebox?

    What I want to do is show the user a message and give then 3 options to choose from each doing something different.

    2) How do you return something from a function? I can do it in VB.Net but is there a way to do it in vba?

  2. #2
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    1) AFAIK there is no way to customise the buttons in a messagebox - you would need to create a user form for this purpose that you can customise to your heart's content.

    2) You return something from a function by giving the function a value. For example,

    [vba]
    Function MyMessage() As String
    ' code here
    ...

    MyMessage = "This is my message"
    End Function[/vba]

    You declare the function as a type in the same way as a variable, and the value you set for your function needs to correspond to the type set.

  3. #3
    Oh aiight. Thanks alot. Seems like i misssed the move obivious.

  4. #4
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    1) Here's a link http://www.xcelfiles.com/API_11.html which shows
    that someone has managed it. Not easy to do though.

    Marcster.

Posting Permissions

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