Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA msgbox function

I want to have a msgbox prompt that has two lines of text, eg:

MsgBox("This is the first line
this is the second line")

I understand that I have to use a carriage return character, but can't seem
to get the syntax right. Can anybody help?

Les.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default VBA msgbox function

MsgBox "First line" & vbNewLine & "Second line"

--

Vasant


"LesLdh" wrote in message
...
I want to have a msgbox prompt that has two lines of text, eg:

MsgBox("This is the first line
this is the second line")

I understand that I have to use a carriage return character, but can't

seem
to get the syntax right. Can anybody help?

Les.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default VBA msgbox function

Les

Msgbox "This is the first line"&Chr(13)&"This is the second"

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"LesLdh" wrote in message
...
I want to have a msgbox prompt that has two lines of text, eg:

MsgBox("This is the first line
this is the second line")

I understand that I have to use a carriage return character, but can't
seem
to get the syntax right. Can anybody help?

Les.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA msgbox function

Try this:

MsgBox("This is the first line" & vbCrLf & "this is the second line")

HTH

Alan P.

"LesLdh" wrote in message
...
I want to have a msgbox prompt that has two lines of text, eg:

MsgBox("This is the first line
this is the second line")

I understand that I have to use a carriage return character, but can't
seem
to get the syntax right. Can anybody help?

Les.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Function and msgbox CC Excel Worksheet Functions 6 July 21st 06 09:41 AM
MsgBox Function and Arguments Tinä[_5_] Excel Programming 0 November 12th 04 03:16 PM
MsgBox Function and Arguments Tinä[_4_] Excel Programming 1 November 12th 04 02:39 PM
MsgBox Bob Phillips[_6_] Excel Programming 0 April 8th 04 09:11 AM
MsgBox Grey Newt Excel Programming 0 April 8th 04 12:01 AM


All times are GMT +1. The time now is 09:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"