Cell Contents as text in Msg Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
MsgBox "You Logged Out At "&Now&"."
or
MsgBox "You Logged Out At "&Range("A1")&"."

Regards,
Stefi

„JB2010†ezt írta:
 
Hi
Not much change in what you have already:

MsgBox "You logged out on " & Now()

regards
Paul
 
Many thanks, just what i needed


cheers


jb

Bob Phillips said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top