#1   Report Post  
saziz
 
Posts: n/a
Default Message Box "Value"


Hi All,
I have written a macro to do several calculations in several sheets.
Now I want to put the answer in a message box. The answer is in a
defined field. All I am trying to do is "the answer is" & "here I want
to give address of the defined filed"
How can I do that?
Thanks for ur help.
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=382585

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Do you mean

MsgBox "The answer is in A1"

or

MsgBox "The answer is " & Range("A1").Value

--

HTH

RP
(remove nothere from the email address if mailing direct)


"saziz" wrote in message
...

Hi All,
I have written a macro to do several calculations in several sheets.
Now I want to put the answer in a message box. The answer is in a
defined field. All I am trying to do is "the answer is" & "here I want
to give address of the defined filed"
How can I do that?
Thanks for ur help.
Syed


--
saziz
------------------------------------------------------------------------
saziz's Profile:

http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=382585



  #3   Report Post  
saziz
 
Posts: n/a
Default


Bob,
I mean the second of ur two. MsgBox "The answer is " &
Range("A1").Value
I will try this.
Thanks


Bob Phillips Wrote:
Do you mean

MsgBox "The answer is in A1"

or

MsgBox "The answer is " & Range("A1").Value

--

HTH

RP
(remove nothere from the email address if mailing direct)


"saziz" wrote in
message
...

Hi All,
I have written a macro to do several calculations in several sheets.
Now I want to put the answer in a message box. The answer is in a
defined field. All I am trying to do is "the answer is" & "here I

want
to give address of the defined filed"
How can I do that?
Thanks for ur help.
Syed


--
saziz

------------------------------------------------------------------------
saziz's Profile:

http://www.excelforum.com/member.php...fo&userid=6350
View this thread:

http://www.excelforum.com/showthread...hreadid=382585



--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=382585

  #4   Report Post  
saziz
 
Posts: n/a
Default


Hi Bob,
I tried following:
MsgBox "The Average is" & Sheet3!Range("p2").Value
It says 'Object required'
Syed




Bob Phillips Wrote:
Do you mean

MsgBox "The answer is in A1"

or

MsgBox "The answer is " & Range("A1").Value

--

HTH

RP
(remove nothere from the email address if mailing direct)


"saziz" wrote in
message
...

Hi All,
I have written a macro to do several calculations in several sheets.
Now I want to put the answer in a message box. The answer is in a
defined field. All I am trying to do is "the answer is" & "here I

want
to give address of the defined filed"
How can I do that?
Thanks for ur help.
Syed


--
saziz

------------------------------------------------------------------------
saziz's Profile:

http://www.excelforum.com/member.php...fo&userid=6350
View this thread:

http://www.excelforum.com/showthread...hreadid=382585



--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=382585

  #5   Report Post  
anilsolipuram
 
Posts: n/a
Default


you extract the value from Sheet3 at p2 cell, it should
sheets("Sheet3").Range("p2").Value


try this

MsgBox "The Average is" & sheets("Sheet3").Range("p2").Value


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=382585



  #6   Report Post  
saziz
 
Posts: n/a
Default


Thank you Anil it is working. How can I restrict decimal places, it is
giving me all 14 decimal places. Is there a format syntax?
Thank you


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=382585

  #7   Report Post  
anilsolipuram
 
Posts: n/a
Default


Yes use
format(sheets("Sheet3").Range("p2").Value,"#.##")
this will give two decimal places

MsgBox "The Average is" &
format(sheets("Sheet3").Range("p2").Value,"#.##")


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=382585

  #8   Report Post  
saziz
 
Posts: n/a
Default


Thanks once again Anil
It works perfectly.


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=382585

  #9   Report Post  
saziz
 
Posts: n/a
Default


Anil,
Can you please show me how to increase the font size in message box?
what would be the syntax?
Thanks


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=382585

  #10   Report Post  
anilsolipuram
 
Posts: n/a
Default


take a look at this link

http://www.mrexcel.com/archive/General/13364.html


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=382585



  #11   Report Post  
Elizabeth
 
Posts: n/a
Default

Anil:
Is there a way to format a number in a msgbox if it is: 1) preceded by
text, & 2) calculated in the code, not drawn from a worksheet? I want to
display a message similar to this example ("The sum is: ") with the number in
123,456 format. I am able to format the number alone using the following
code, but I can't figure out how to add "The sum is: " and retain the comma
formatting.
MsgBox prompt:=Format(expression:=totalvar, Format:="0,0")
Thank you for any suggestions!
Elizabeth

"anilsolipuram" wrote:


Yes use
format(sheets("Sheet3").Range("p2").Value,"#.##")
this will give two decimal places

MsgBox "The Average is" &
format(sheets("Sheet3").Range("p2").Value,"#.##")


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=382585


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
Calculations And Order In Macros Carl Bowman Excel Discussion (Misc queries) 4 February 23rd 05 10:53 PM
when opening excel I receive a message that says file can't be fo. Ken Excel Discussion (Misc queries) 3 February 22nd 05 12:13 AM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
Error Message appearing when saving a file JaneC Excel Discussion (Misc queries) 0 November 25th 04 10:35 PM
#num! error message Frank Kabel Excel Worksheet Functions 0 November 18th 04 07:07 PM


All times are GMT +1. The time now is 12:20 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"