MsgBox Help

~Zodiac~

Board Regular
Joined
Jan 10, 2005
Messages
70
hi

my code is this

MsgBox prompt:=Text2, Buttons:=vbOKOnly, Title:=Title2

both text and title are variables wich i declared in advance, they are filled with text

when i want to run this it gives me a
Runtime Error 13
Type Mismatch

in what way do i have to alter the msgbox in order to let it work properly?

(yes displaying that text in a msgbox is all i want)

Thanks in Advance
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
without seeing all your code can't tell why. But this works:

Code:
Sub box()
Text2 = "Hello"
Title2 = "Info"
MsgBox prompt:=Text2, Buttons:=vbOKOnly, Title:=Title2
End Sub

HTH
texasalynn
 
Upvote 0
a piece of my code


Dim Text2 As String
Text2 = "Haal nu met MRS de Moves binnen, en sla deze op als X:\Departments_M_Z\TPD\METL\Teams\data\" + Jaar + "\moves\" + Maand + "\Selectie.xls"

...
'some events that work fine (never altering Text2)
...

Title2="ARC304"
MsgBox prompt:=Text2, Buttons:=vbOKOnly, Title:=Title2

could it be that my Text2 is to long? and if so what declaration should be used for this?

pls help me out

Thanks in Advance

Please continue your questions in the post and not in PM, that way others might have a chance to answer you.

What is happening? This works fine for me. Are you getting an error?

texasalynn
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top