#1
|
|||
|
|||
Problem with Msgbox in VBA
I am trying to use a message box, but Excel won't accept a title
eg Msgbox("This is a test message",,"Test Message") When I press Enter I get a message Compile Error Expected: = I am very puzzled. It works correctly without a title eg Msgbox("This is a test message") Any thoughts........... and many thanks Puzzled Programmer |
#2
|
|||
|
|||
Take off the parenthesis...
Code:
Sub MessageBox() MsgBox "This is a test message", , "This is a Message" End Sub |
#3
|
|||
|
|||
That doesn't work
I have already tried that
For instance Msgbox("This is a test message",,Test Message) produces an error Compile error Expected: List separator or ) still puzzled... but thanks for your swift response |
#4
|
|||
|
|||
Did you try exactly what I posted? I see you still have the parenthesis in your post #3.
|
#5
|
|||
|
|||
Aha - sorry I misunderstood.
Eureka Msgbox "This is a test message",,"Test message" seems to work. Interesting, I have always included parentheses in Msgbox statements before, but as far as I remember this is the first time I have tried to put a title in as well. Thanks for your help Puzzled no longer |
#6
|
|||
|
|||
You are very welcome. Happy to help in some small way and happy Exceling.
|
#7
|
|||
|
|||
This line as is expects an input from the messagebox to be returned to a variable Msgbox("This is a test message",,"Test Message")
This should work... T = Msgbox("This is a test message",,"Test Message") |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
msgbox when deleting cells | Mikedk64 | Excel Programming | 11 | 07-13-2017 07:14 AM |
Trigger Beep or MsgBox when key combo accidentally pressed | NotQuiteANovice | Word VBA | 1 | 04-07-2017 05:41 PM |
On Open MsgBox for use in Template sent out to colleagues to gather information | Lancashire Lad | Word VBA | 2 | 10-26-2015 10:22 AM |
Problem Sending Command to the Program - Office or Windows Problem ?? | JosieNurse | Office | 0 | 04-21-2015 11:49 AM |
Make MsgBox appear... | Jamtart | PowerPoint | 3 | 09-01-2012 08:21 AM |