Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi,
I am creating a message box as part of a form template using the code: vAnswer = MsgBox(Prompt:="text", Buttons:=vbOKOnly) If vAnswer = vbOK Then Exit Sub End If The text I'd like to enter is a reminder to do 3 things, and I'd like each item to appear on a new line. The help file suggested inserting Chr(13) -- a carriage return -- to start a new line, but I can't figure out how to do this. If I add Chr(13) within the quotes, it just appears as part of the text. If I end the quotes, add Chr(13) and restart the quotes, I get an error when I test the form. Any suggestions for how specify new lines within the Prompt for a message box??? Thanks in advance |
#2
![]() |
|||
|
|||
![]()
Wendy,
Use the & operator to conenct literal and string variables. Try one of these: Sub Text() If MsgBox("Wash hands," & vbCr & "brush teeth," _ & vbCr & "and comb hair", vbOK) = vbOK Then Exit Sub End If End Sub Sub Text1() If MsgBox("Wash hands," & Chr(13) & "brush teeth," _ & Chr(13) & "and comb hair", vbOK) = vbOK Then Exit Sub End If End Sub |
#3
![]() |
|||
|
|||
![]()
Thanks very much Greg - that did the trick!
"Greg" wrote: Wendy, Use the & operator to conenct literal and string variables. Try one of these: Sub Text() If MsgBox("Wash hands," & vbCr & "brush teeth," _ & vbCr & "and comb hair", vbOK) = vbOK Then Exit Sub End If End Sub Sub Text1() If MsgBox("Wash hands," & Chr(13) & "brush teeth," _ & Chr(13) & "and comb hair", vbOK) = vbOK Then Exit Sub End If End Sub |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Bullets/numbers will not indent after first line | Microsoft Word Help | |||
When I press enter in MS Word it does not start on the next line . | Page Layout | |||
Making a Form :: Line Borders / Table Cells with Flowing Text | Microsoft Word Help | |||
space @ start of line | New Users | |||
When I start typing, the background for that line turns black and. | New Users |