Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have variables for year, month, day, and hour. Is there a date
function I can use to view the date as follows: m/d/yyyy h:mm DateFunction(year, month, day, hour) --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think I can use this
CurrentDate = DateSerial(CurrentYear, CurrentMonth, CurrentDay) CurrentHour / 2 -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ExcelMonkey,
DateSerial and TimeSerial eg. Sub test() Dim lngYear As Long, lngMonth As Long, lngDay As Long, lngHour As Long Dim dtm As Date lngYear = 2004 lngMonth = 2 lngDay = 1 lngHour = 12 dtm = DateSerial(lngYear, lngMonth, lngDay) + TimeSerial(lngHour, 0, 0) MsgBox Format(dtm, "dd-Mmm-yyyy HH:mm:ss") End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "ExcelMonkey " wrote in message ... I have variables for year, month, day, and hour. Is there a date function I can use to view the date as follows: m/d/yyyy h:mm DateFunction(year, month, day, hour) --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
myDate = DateSerial(year, month, day) + hour / 24 MsgBox Format(myDate, "m/d/yyyy h:mm") In article , ExcelMonkey wrote: I have variables for year, month, day, and hour. Is there a date function I can use to view the date as follows: m/d/yyyy h:mm DateFunction(year, month, day, hour) --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Function to lookup date on tab in excel and populate date on calen | Excel Worksheet Functions | |||
Difference betwen Excel Date () Function and System Date | Excel Worksheet Functions | |||
SUMIF within date range as a function of today()'s date | Excel Worksheet Functions | |||
Date Function formula that will return the date of a specific week | Excel Worksheet Functions | |||
Calculating days between current date and a date in future NETWORKDAYS() function | Excel Worksheet Functions |