Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i am working on developing a test to be administered to a candidate.
how can control the process by time. when the test-taker clicks th "start test" button, i can record the "system time" (DateTimeStart) a that moment. but how do i ensure that at the end of a pre-specifie duration, that is when "system time" becomes = DateTimeStart TestDuration, a macro is initiated automatically which will end th test. am a novice in macro code writing. would appreciate if you can use beginner's language in your respnse. many thanks -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check out the OnTime method. Good description at
www.cpearson.com/excel/ontime.htm -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "arunjoshi " wrote in message ... i am working on developing a test to be administered to a candidate. how can control the process by time. when the test-taker clicks the "start test" button, i can record the "system time" (DateTimeStart) at that moment. but how do i ensure that at the end of a pre-specified duration, that is when "system time" becomes = DateTimeStart + TestDuration, a macro is initiated automatically which will end the test. am a novice in macro code writing. would appreciate if you can use a beginner's language in your respnse. many thanks. --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It depends on what exactly the test consists of, but I'll try one approach
The code below assumes that the "start test" button runs a macro called "start" It also assumes that the candidate is entering her answers on a sheet called "Sheet1" The "start" macro makes Sheet1 visible and then sets a timer for 45 minutes, at the end of which time the macro "stoppem" will run. The stoppem macro makes the sheet invisible and saves the workbook, though currently it will ask the candidate's permission to save it. Lots more security will be needed, like disabling the start button once it has been run but the timer function should work OK ''''''''''''''''''''''''''''''' Dim dateTimeStart As Date Sub start() Dim testDuration As Date testDuration = TimeValue("00:45:00") Sheets("Sheet1").Visible = True dateTimeStart = Now Application.OnTime _ dateTimeStart + testDuration, "stoppem" End Sub Sub stoppem() With Sheets("Sheet1") .Visible = xlVeryHidden .Range("Z99").Value = dateTimeStart End With ThisWorkbook.Save End Sub ''''''''''''''''''''''''''''''''''''''''' arunjoshi < wrote: i am working on developing a test to be administered to a candidate. how can control the process by time. when the test-taker clicks the "start test" button, i can record the "system time" (DateTimeStart) at that moment. but how do i ensure that at the end of a pre-specified duration, that is when "system time" becomes = DateTimeStart + TestDuration, a macro is initiated automatically which will end the test. am a novice in macro code writing. would appreciate if you can use a beginner's language in your respnse. many thanks. --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an example on my website
"Schedule a macro to run" -- Rob van Gelder - http://www.vangelder.co.nz/excel "arunjoshi " wrote in message ... i am working on developing a test to be administered to a candidate. how can control the process by time. when the test-taker clicks the "start test" button, i can record the "system time" (DateTimeStart) at that moment. but how do i ensure that at the end of a pre-specified duration, that is when "system time" becomes = DateTimeStart + TestDuration, a macro is initiated automatically which will end the test. am a novice in macro code writing. would appreciate if you can use a beginner's language in your respnse. many thanks. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Macro for time "Excel 2003" | Excel Discussion (Misc queries) | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
excel macro - macro initiation upon hitting the ener key | Excel Programming |