Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default msgBox problem

I would like to used named parameters in a msgBox, but this does not seem to
work.
MsgBox ("Time period 1: " & vbLf & "The ending velocity was " & vel & " m/s,
and the starting velocity was " & vInit1 & ", so the Delta v was " & (vel -
vInit1) & " m/s", Title:="End of first period")

When I leave off the named paramter, it works just fine (without a title).
MsgBox ("Time period 1: " & vbLf & "The ending velocity was " & vel & " m/s,
and the starting velocity was " & vInit1 & ", so the Delta v was " & (vel -
vInit1) & " m/s")

Am I doing something wrong with the named parameter?

Thanks

--
Jeff Ciaccio
Physics and AP Physics Teacher
Sprayberry High School; Marietta, GA
Blog: http://sprayberry.typepad.com/ciaccio

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default msgBox problem

That did the trick, but how does the following work?? Notice the
parenthesis are included, and this compiles and runs fine. Wierd :)
msg = MsgBox(OutputString, Title:="Your prime numbers")


"Sandy Mann" wrote in message
...
Try removing the parenthesis:

MsgBox "Time period 1: " & vbLf & "The ending velocity was " & vel & _
" m/s, and the starting velocity was " & vInit1 & ", so the Delta v was "
_
& (vel - vInit1) & " m/s", Title:="End of first period"

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Jeff Ciaccio" wrote in message
...
I would like to used named parameters in a msgBox, but this does not seem
to work.
MsgBox ("Time period 1: " & vbLf & "The ending velocity was " & vel & "
m/s, and the starting velocity was " & vInit1 & ", so the Delta v was " &
(vel - vInit1) & " m/s", Title:="End of first period")

When I leave off the named paramter, it works just fine (without a
title).
MsgBox ("Time period 1: " & vbLf & "The ending velocity was " & vel & "
m/s, and the starting velocity was " & vInit1 & ", so the Delta v was " &
(vel - vInit1) & " m/s")

Am I doing something wrong with the named parameter?

Thanks

--
Jeff Ciaccio
Physics and AP Physics Teacher
Sprayberry High School; Marietta, GA
Blog:
http://sprayberry.typepad.com/ciaccio





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,345
Default msgBox problem

Because the response from the Mesaage Box, (ie the button pressed), is being
assigned to the variable msg. The Parenthsis in you original code was
making XL think that you want to assign a variable and so it said that it
expected a "=". With no parenthsis is just give a message so no assignment
is necessary.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Jeff Ciaccio" wrote in message
...
That did the trick, but how does the following work?? Notice the
parenthesis are included, and this compiles and runs fine. Wierd :)
msg = MsgBox(OutputString, Title:="Your prime numbers")


"Sandy Mann" wrote in message
...
Try removing the parenthesis:

MsgBox "Time period 1: " & vbLf & "The ending velocity was " & vel & _
" m/s, and the starting velocity was " & vInit1 & ", so the Delta v was "
_
& (vel - vInit1) & " m/s", Title:="End of first period"

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Jeff Ciaccio" wrote in message
...
I would like to used named parameters in a msgBox, but this does not seem
to work.
MsgBox ("Time period 1: " & vbLf & "The ending velocity was " & vel & "
m/s, and the starting velocity was " & vInit1 & ", so the Delta v was "
&
(vel - vInit1) & " m/s", Title:="End of first period")

When I leave off the named paramter, it works just fine (without a
title).
MsgBox ("Time period 1: " & vbLf & "The ending velocity was " & vel & "
m/s, and the starting velocity was " & vInit1 & ", so the Delta v was "
&
(vel - vInit1) & " m/s")

Am I doing something wrong with the named parameter?

Thanks

--
Jeff Ciaccio
Physics and AP Physics Teacher
Sprayberry High School; Marietta, GA
Blog:
http://sprayberry.typepad.com/ciaccio








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
Problem in Msgbox() ashish128 Excel Discussion (Misc queries) 4 August 30th 07 04:19 PM
MsgBox Problem Rob Excel Programming 4 September 9th 06 01:39 AM
Problem with array and msgbox aking1987 Excel Worksheet Functions 0 November 1st 04 08:57 AM
Problem with array and msgbox aking1987 Excel Worksheet Functions 1 October 29th 04 01:57 PM
Problem with array and msgbox aking1987 Excel Worksheet Functions 2 October 28th 04 06:20 PM


All times are GMT +1. The time now is 04:31 AM.

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"