ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell Contents as text in Msg Box (https://www.excelbanter.com/excel-programming/361060-cell-contents-text-msg-box.html)

JB2010

Cell Contents as text in Msg Box
 
Hi


Is there any way to take the contents of a cell & add that to the text you
programme into a Msg Box in VB?


For example, lets say cell A1 has the following formula "=Now()", meaning
text that says "10/05/06 13:47"


& I want the Msg Box to read "You Logged Out At 10/05/06 13:47."

Is there a way of sinking this formula into the VB code for a Msg Box? On a
spreadsheet i would obviously use (="You Logged Out At "&A1&"."), but VB is
getting confusing!


Any help gratefully receieved


cheers


jb

Ardus Petus

Cell Contents as text in Msg Box
 
MsgBox "You Logged Out At " & range("A1").Text

HTH
--
AP

"JB2010" a écrit dans le message de news:
...
Hi


Is there any way to take the contents of a cell & add that to the text you
programme into a Msg Box in VB?


For example, lets say cell A1 has the following formula "=Now()", meaning
text that says "10/05/06 13:47"


& I want the Msg Box to read "You Logged Out At 10/05/06 13:47."

Is there a way of sinking this formula into the VB code for a Msg Box? On
a
spreadsheet i would obviously use (="You Logged Out At "&A1&"."), but VB
is
getting confusing!


Any help gratefully receieved


cheers


jb




Bob Phillips[_14_]

Cell Contents as text in Msg Box
 
Msgbox "You are Logged Out At" & Format(Range("A1").Value, "dd.mm.yy hh:mm")
& "."

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"JB2010" wrote in message
...
Hi


Is there any way to take the contents of a cell & add that to the text you
programme into a Msg Box in VB?


For example, lets say cell A1 has the following formula "=Now()", meaning
text that says "10/05/06 13:47"


& I want the Msg Box to read "You Logged Out At 10/05/06 13:47."

Is there a way of sinking this formula into the VB code for a Msg Box? On

a
spreadsheet i would obviously use (="You Logged Out At "&A1&"."), but VB

is
getting confusing!


Any help gratefully receieved


cheers


jb




Don Guillett

Cell Contents as text in Msg Box
 
forget the now cell and try this

Sub timeinmsgbox()
MsgBox "You " & Time
End Sub

--
Don Guillett
SalesAid Software

"JB2010" wrote in message
...
Hi


Is there any way to take the contents of a cell & add that to the text you
programme into a Msg Box in VB?


For example, lets say cell A1 has the following formula "=Now()", meaning
text that says "10/05/06 13:47"


& I want the Msg Box to read "You Logged Out At 10/05/06 13:47."

Is there a way of sinking this formula into the VB code for a Msg Box? On
a
spreadsheet i would obviously use (="You Logged Out At "&A1&"."), but VB
is
getting confusing!


Any help gratefully receieved


cheers


jb




Stefi

Cell Contents as text in Msg Box
 

MsgBox "You Logged Out At "&Now&"."
or
MsgBox "You Logged Out At "&Range("A1")&"."

Regards,
Stefi

€žJB2010€ť ezt Ă*rta:

Hi


Is there any way to take the contents of a cell & add that to the text you
programme into a Msg Box in VB?


For example, lets say cell A1 has the following formula "=Now()", meaning
text that says "10/05/06 13:47"


& I want the Msg Box to read "You Logged Out At 10/05/06 13:47."

Is there a way of sinking this formula into the VB code for a Msg Box? On a
spreadsheet i would obviously use (="You Logged Out At "&A1&"."), but VB is
getting confusing!


Any help gratefully receieved


cheers


jb


[email protected]

Cell Contents as text in Msg Box
 
Hi
Not much change in what you have already:

MsgBox "You logged out on " & Now()

regards
Paul


JB2010

Cell Contents as text in Msg Box
 
Many thanks, just what i needed


cheers


jb

"Bob Phillips" wrote:

Msgbox "You are Logged Out At" & Format(Range("A1").Value, "dd.mm.yy hh:mm")
& "."

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"JB2010" wrote in message
...
Hi


Is there any way to take the contents of a cell & add that to the text you
programme into a Msg Box in VB?


For example, lets say cell A1 has the following formula "=Now()", meaning
text that says "10/05/06 13:47"


& I want the Msg Box to read "You Logged Out At 10/05/06 13:47."

Is there a way of sinking this formula into the VB code for a Msg Box? On

a
spreadsheet i would obviously use (="You Logged Out At "&A1&"."), but VB

is
getting confusing!


Any help gratefully receieved


cheers


jb






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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com