Is there a way to make a mulilined message box? If so, how?
Printable View
Is there a way to make a mulilined message box? If so, how?
dim msg as string
msg = "help me out" & vbcrlf
msg = "please help me out" & vbcrlf
msg = msg & vbcrlf
msg = msg & "Sure hope you get it!"
msgbox = msg
or you can use the vbNewLine constant, like this
Code:Private Sub Command1_Click()
MsgBox "This" & vbNewLine & _
"Is" & vbNewLine & _
"A" & vbNewLine & _
"Test!"
End Sub
This is the code I have:
Then it comes up with this:Code:Private Sub CommandButton1_Click()
If Range("O2").Text = "When I Am Typing My Name in the Employee Name Box, my name does not appear. What do I do?" Then
Dim msg As String
msg = "- Make sure you have triple clicked your mouse INSIDE the employee name box." & vbCrLf
msg = "- Make sure you are typing your LAST name first." & vbCrLf
msg = "- Make sure you put a comma and a space after your last name." & vbCrLf
msg = "- If your name does not appear as you are typing it, scroll through the list and locate it manually."
MsgBox = vbOK
End If
End Sub
COMPILE ERROR
Function call on left-hand side of assignment must return Variant or Object.
What am I doing wrong?
Msgbox is a function and you cannot assign a value to it.
CoreyS, incorrect, the code should be:
That should do it!Code:Private Sub CommandButton1_Click()
If Range("O2").Text = "When I Am Typing My Name in the Employee Name Box, my name does not appear. What do I do?" Then
Dim msg As String
msg = "- Make sure you have triple clicked your mouse INSIDE the employee name box." & vbCrLf
msg = msg & "- Make sure you are typing your LAST name first." & vbCrLf
msg = msg & "- Make sure you put a comma and a space after your last name." & vbCrLf
msg = msg & "- If your name does not appear as you are typing it, scroll through the list and locate it manually."
MsgBox msg
End If
End Sub