Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
date function
i am trying to creat a script than i can assign to a button, so when i click
on it a dialog box appears with which will show tha days,hours,min and secounds left till a given date that i can adjust in the script ,,,, I have mannaged to get one to work in lotus 123 but not sure how to do it in excel, any ideas ?? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
date function
'/==========================================/
Sub TimeLeft() 'days,hours,min and secounds left till a given date Dim dblTimeLeft As Double Dim dblDays As Double Dim dblHours As Double Dim dblMinutes As Double Dim dblSeconds As Double Dim strDate As String strDate = "10/31/2006 08:00 AM" dblTimeLeft = DateValue(strDate) + TimeValue(strDate) - Now() dblDays = Int(dblTimeLeft) dblHours = Int((dblTimeLeft - dblDays) * 24) dblMinutes = _ Int((dblTimeLeft - dblDays - (dblHours / 24)) * 24 * 60) dblSeconds = _ Int((dblTimeLeft - dblDays - (dblHours / 24) - _ (dblMinutes / 24 / 60)) * 24 * 60 * 60) MsgBox _ "Days: " & dblDays & vbCr & _ "Hours: " & dblHours & vbCr & _ "Minutes: " & dblMinutes & vbCr & _ "Seconds: " & dblSeconds & vbCr, vbInformation, _ "Time Left until " & strDate & "..." End Sub '/==========================================/ HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Stan Halls" wrote: i am trying to creat a script than i can assign to a button, so when i click on it a dialog box appears with which will show tha days,hours,min and secounds left till a given date that i can adjust in the script ,,,, I have mannaged to get one to work in lotus 123 but not sure how to do it in excel, any ideas ?? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
date function
Thank you for that i worked a treat,,,,,,
"Gary L Brown" wrote: '/==========================================/ Sub TimeLeft() 'days,hours,min and secounds left till a given date Dim dblTimeLeft As Double Dim dblDays As Double Dim dblHours As Double Dim dblMinutes As Double Dim dblSeconds As Double Dim strDate As String strDate = "10/31/2006 08:00 AM" dblTimeLeft = DateValue(strDate) + TimeValue(strDate) - Now() dblDays = Int(dblTimeLeft) dblHours = Int((dblTimeLeft - dblDays) * 24) dblMinutes = _ Int((dblTimeLeft - dblDays - (dblHours / 24)) * 24 * 60) dblSeconds = _ Int((dblTimeLeft - dblDays - (dblHours / 24) - _ (dblMinutes / 24 / 60)) * 24 * 60 * 60) MsgBox _ "Days: " & dblDays & vbCr & _ "Hours: " & dblHours & vbCr & _ "Minutes: " & dblMinutes & vbCr & _ "Seconds: " & dblSeconds & vbCr, vbInformation, _ "Time Left until " & strDate & "..." End Sub '/==========================================/ HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Stan Halls" wrote: i am trying to creat a script than i can assign to a button, so when i click on it a dialog box appears with which will show tha days,hours,min and secounds left till a given date that i can adjust in the script ,,,, I have mannaged to get one to work in lotus 123 but not sure how to do it in excel, any ideas ?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"year" date function | Excel Discussion (Misc queries) | |||
Date formulas | Excel Discussion (Misc queries) | |||
Mileage Claim Formula | New Users to Excel | |||
NETWORKDAYS - Multiple Date Selection | Excel Discussion (Misc queries) | |||
Date function | Excel Worksheet Functions |