Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hey Vijay, thanks for the response, the color piece is not working:
here is my code for the countdown clock: Sub StartKlokka() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 1) = 0 Cells(3, 2) = 0 Range("A3").Select ActiveCell.FormulaR1C1 = "=RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling5() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "00:05:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""00:05:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling10() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "00:10:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""00:10:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling15() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "00:15:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""00:15:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling20() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "00:20:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""00:20:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling30() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "00:30:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""00:30:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling45() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "00:45:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""00:45:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling60() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "01:00:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""01:00:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling90() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "01:30:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""01:30:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub Nedtelling120() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "02:00:00" Range("A3").Select ActiveCell.FormulaR1C1 = "=""02:00:00""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid 3 GoTo 1 End Sub Sub NedtellingTest() ' ' StartKlokka Macro ' Macro recorded 02.05.02 by Oddvar Gorset ' ' Cells(3, 2) = "00:00:00" Cells(3, 1) = "00:00:05" Range("A3").Select ActiveCell.FormulaR1C1 = "=""00:00:05""-RC[1]" Starttid = Now() 1 Calculate newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + 1 waitTime = TimeSerial(newHour, newMinute, newSecond) Application.Wait waitTime Aktuelltid = Now() Tid = Aktuelltid - Starttid Cells(3, 2) = Tid If Tid < 0 Then GoTo 4 3 GoTo 1 4 End End Sub "Vijay Chary" wrote: Hi Johnny !! :) I'm g;ad you could do it . To make the screen flash red at the end of the countdown, you could add these lines to the code. '*******************Add this piece of code******************** Range("c8:e16").Select for c = 1 to 10 For a = 1 to 5 Selection.Interior.ColorIndex = n1 ' where n1 = color index for RED next a For b = 1 to 5 Selection.Interior.ColorIndex = n2 'where n2 = color index for No Color next b next c 'Record a Macro to set up a hyperlind to the photo that you want to call up at the 'end of the countdown. Add this piece of code to your Countdown Macro at the end. Good Luck !! Vijay "Johnny Excel" wrote: I have a countdown clock in Excel that counts down from 5 min, 10 min, 15 min, 20 min. I need 30 min, 45 min, 60 min, and 90 min added to it. Can anyone help me? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I calculate time in excel (clock in and clock out | Excel Discussion (Misc queries) | |||
Change EXCEL Clock to Standard Clock or Military Time | Excel Worksheet Functions | |||
Countdown | Excel Worksheet Functions | |||
can i get a cell to countdown with the computer clock in excel | Excel Discussion (Misc queries) | |||
Start Clock/Stop Clock | Excel Discussion (Misc queries) |