PDA

View Full Version : Msgbox and Functions



bwells
05-24-2006, 12:56 PM
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?

geekgirlau
05-25-2006, 12:38 AM
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,


Function MyMessage() As String
' code here
...

MyMessage = "This is my message"
End Function

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.

bwells
05-25-2006, 05:18 AM
Oh aiight. Thanks alot. Seems like i misssed the move obivious.

Marcster
05-25-2006, 10:24 AM
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.