Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Incorpoarting cell contents into a message box


Hi All

I'm trying to incorporate the contents of cell A1 into a message box but
am struggling for syntax. The content of A1 is text resultant of a
formula.

The box has some leading and trailing text ;

MsgBox "Please go to " (contents of A1) " for further information."


Grateful for any advice
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Incorpoarting cell contents into a message box

On Jun 1, 8:10*pm, Colin Hayes wrote:
Hi All

I'm trying to incorporate the contents of cell A1 into a message box but
am struggling for syntax. *The content of A1 is text resultant of a
formula.

The box has some leading and trailing text ;

MsgBox "Please go to " *(contents of A1) *" for further information."

Grateful for any advice


Sub marine()
MsgBox "Please go to " & Range("A1").Value & " for further
information."
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Incorpoarting cell contents into a message box

In article
,
James Ravenswood writes
On Jun 1, 8:10*pm, Colin Hayes wrote:
Hi All

I'm trying to incorporate the contents of cell A1 into a message box but
am struggling for syntax. *The content of A1 is text resultant of a
formula.

The box has some leading and trailing text ;

MsgBox "Please go to " *(contents of A1) *" for further information."

Grateful for any advice


Sub marine()
MsgBox "Please go to " & Range("A1").Value & " for further
information."
End Sub


Hi

OK thanks for that.

As the content is a date , it is returning 01/01/2011 in the message
box, when the cell itself is formatted to read January 2011.

Is it possible to modify the code to return a mmmm yyyy format in the
message box?

Thanks again.
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Incorpoarting cell contents into a message box

As the content is a date , it is returning 01/01/2011
in the message box, when the cell itself is formatted
to read January 2011.

Is it possible to modify the code to return a
mmmm yyyy format in the message box?


You do realize if you don't tell us all of your conditions up front, there
is minimum chance that we would be able to guess them, right?

Give this code a line a try...

MsgBox "Please go to " & Format(Range("A1").Value, _
Range("A1").NumberFormat) & " for further"

Rick Rothstein (MVP - Excel)

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Incorpoarting cell contents into a message box

In article , Rick Rothstein
writes
As the content is a date , it is returning 01/01/2011
in the message box, when the cell itself is formatted
to read January 2011.

Is it possible to modify the code to return a
mmmm yyyy format in the message box?


You do realize if you don't tell us all of your conditions up front, there
is minimum chance that we would be able to guess them, right?

Give this code a line a try...

MsgBox "Please go to " & Format(Range("A1").Value, _
Range("A1").NumberFormat) & " for further"

Rick Rothstein (MVP - Excel)



Hi

OK thanks for your help. It works fine now.

I'm grateful for your time and expertise.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 420
Default Incorpoarting cell contents into a message box

This may work, too:

MsgBox "Please go to " & Range("A1").text & " for further"

On 06/01/2011 21:33, Rick Rothstein wrote:
As the content is a date , it is returning 01/01/2011
in the message box, when the cell itself is formatted
to read January 2011.

Is it possible to modify the code to return a
mmmm yyyy format in the message box?


You do realize if you don't tell us all of your conditions up front, there is
minimum chance that we would be able to guess them, right?

Give this code a line a try...

MsgBox "Please go to " & Format(Range("A1").Value, _
Range("A1").NumberFormat) & " for further"

Rick Rothstein (MVP - Excel)


--
Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default Incorpoarting cell contents into a message box

In article , Dave Peterson
writes
This may work, too:

MsgBox "Please go to " & Range("A1").text & " for further"


Hi Dave

OK thanks for that - it works perfectly first time also.

Best Wishes


On 06/01/2011 21:33, Rick Rothstein wrote:
As the content is a date , it is returning 01/01/2011
in the message box, when the cell itself is formatted
to read January 2011.

Is it possible to modify the code to return a
mmmm yyyy format in the message box?


You do realize if you don't tell us all of your conditions up front, there is
minimum chance that we would be able to guess them, right?

Give this code a line a try...

MsgBox "Please go to " & Format(Range("A1").Value, _
Range("A1").NumberFormat) & " for further"

Rick Rothstein (MVP - Excel)




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
concatenate contents of cells whose contents resemble cell referem cathyh Excel Worksheet Functions 3 May 23rd 09 12:16 PM
Return cell address of a cell based on contents of cell. Danny Excel Worksheet Functions 4 November 15th 08 03:11 AM
nested Cell("contents", w/ cell contents reference) JASelep Excel Worksheet Functions 1 October 19th 07 12:17 AM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Cell contents vs. Formula contents Sarah Excel Discussion (Misc queries) 3 December 15th 04 06:02 PM


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