ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   actual time and date (https://www.excelbanter.com/excel-discussion-misc-queries/39620-actual-time-date.html)

kizzie

actual time and date
 

Hello,

Does anyone know the command for adding the actual time and date to a
string?

thx in advance


--
kizzie
------------------------------------------------------------------------
kizzie's Profile: http://www.excelforum.com/member.php...o&userid=26092
View this thread: http://www.excelforum.com/showthread...hreadid=394484


ScottO

How about ="String"&Text(Now(),"d/m/yyyy hh:mm")
Rgds,
ScottO

"kizzie" wrote
in message
...
|
| Hello,
|
| Does anyone know the command for adding the actual time and date to
a
| string?
|
| thx in advance
|
|
| --
| kizzie
| -------------------------------------------------------------------
-----
| kizzie's Profile:
http://www.excelforum.com/member.php...o&userid=26092
| View this thread:
http://www.excelforum.com/showthread...hreadid=394484
|



Bob Phillips

If you mean VBA instaed, that is

myVar = "String" & Format(Now,"dd/mm/yyyy hh:mm:ss")

--
HTH

Bob Phillips

"ScottO" wrote in message
...
How about ="String"&Text(Now(),"d/m/yyyy hh:mm")
Rgds,
ScottO

"kizzie" wrote
in message
...
|
| Hello,
|
| Does anyone know the command for adding the actual time and date to
a
| string?
|
| thx in advance
|
|
| --
| kizzie
| -------------------------------------------------------------------
-----
| kizzie's Profile:
http://www.excelforum.com/member.php...o&userid=26092
| View this thread:
http://www.excelforum.com/showthread...hreadid=394484
|





dominicb


Good morning Kizzie

Do you mean within VBA? The code below will add the time in a
prescribed format to a text string, a.

Sub test()
a = "The time is " & Format(Now(), "hh:mm:ss")
MsgBox a
End Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=394484


kizzie


thx , that did the job :)


--
kizzie
------------------------------------------------------------------------
kizzie's Profile: http://www.excelforum.com/member.php...o&userid=26092
View this thread: http://www.excelforum.com/showthread...hreadid=394484



All times are GMT +1. The time now is 11:02 PM.

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