Simpatie.ro - matrimoniale
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
Diana2019
Femeie
25 ani
Vaslui
cauta Barbat
25 - 80 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[EXCEL] Insert myDate and myTime in the Same Cell [VBA]

Pagini: 1 Moderat de TRaP, TonyTzu
#1
TRaP
Moderator
Postari: 960
If you want to add a personal timestamp (you don't want =Now()), for example you want to add a date and a time written in 2 cells, and want the print date to appear in the same cell but contain both date and time.



Dim myDate
Dim myTime

myDate = ActiveSheet.Range("K" & (ActiveCell.Row)).Value
myTime = ActiveSheet.Range("J" & (ActiveCell.Row)).Value

Worksheets("PRINTA5").Range("PrintDate").Value = Format(myDate, "dd.mm.yyyy") + " " + Format(myTime, "hh:mm")


You can see it uses + instead of & to join date and time.

Source for + usage:
https://www.mrexcel.com/forum/excel-que ... ost3658262

More on date and time entry:
http://cpearson.com/excel/DateTimeEntry.htm


 
   
Pagini: 1  
Mergi la