ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   timer (https://www.excelbanter.com/excel-programming/317489-timer.html)

dadad

timer
 

i want to create a self re-setting countdown timer inside an excel cell
i think it is possible but dont know how to get started, ( i'm ver
green with computers), i really need step by step instructions fro
point a ( logging on) to point z (viewing the timer in action). i
anyone can help me, i will be delighted.....thank yo

--
dada
-----------------------------------------------------------------------
dadad's Profile: http://www.excelforum.com/member.php...fo&userid=1671
View this thread: http://www.excelforum.com/showthread.php?threadid=31917


Myrna Larson

timer
 
You've picked a pretty advanced point to start --- programming isn't exactly
beginner's "stuff". What is your level of experience with Excel proper? Can
you handle event macros?

On Sun, 21 Nov 2004 12:42:55 -0600, dadad
wrote:


i want to create a self re-setting countdown timer inside an excel cell,
i think it is possible but dont know how to get started, ( i'm verg
green with computers), i really need step by step instructions from
point a ( logging on) to point z (viewing the timer in action). if
anyone can help me, i will be delighted.....thank you



TK

timer
 
Hi Dadad:

This stuff isn't rocket science but as Myrna points out a little background
is handy and timers are usually put in procedeures that you time.

But ask and you shall receive:

Put a command button on the worksheet.
i.e. click the command button on the toolbar and draw it on the sheet
then click it and paste the following code between Private Sub

CommandButton1_Click()
and
End Sub

and wala your a programmer

I hope his wets your appetite a little, it's a lot of fun.

Good Luck
TK


Private Sub CommandButton1_Click()

Dim lngStart As Double
Dim lngStop As Double
Dim lngTime As Double

lngStart = Timer

' code here.............
Dim Count
Do While Count < 10000
Count = Count + 1
Range("M2") = Count
Loop

With Worksheets("Sheet1").Cells(2, 14)
.Value = Count
.Font.ColorIndex = 3
.Font.Bold = True
.Name = "Arial"
End With

lngStop = Timer

lngTime = (lngStop - lngStart)
MsgBox ("That Took " & Format(lngTime, "##.000") _
& " Seconds"), vbInformation, "Good Luck TK"

End Sub



dadad[_2_]

timer
 

thanks a lot, it looks good. im going to try it now....thanks again

--
dada
-----------------------------------------------------------------------
dadad's Profile: http://www.excelforum.com/member.php...fo&userid=1671
View this thread: http://www.excelforum.com/showthread.php?threadid=31917


dadad[_3_]

timer
 

thanks again TK
ive tried your code and it works perfect, however it it not exactly
what i need.
i want a timer which will show minutes and seconds, it needs to have a
pause conrol and a stop control, it also needs to restart itself on
reaching zero.
also can it be done in such a way that it does not freeze the worksheet
while it is running ?.........thanks again


--
dadad
------------------------------------------------------------------------
dadad's Profile: http://www.excelforum.com/member.php...o&userid=16712
View this thread: http://www.excelforum.com/showthread...hreadid=319178


Dave D-C

timer
 
dadad wrote:
i want to create a self re-setting countdown timer inside an excel cell,
i think it is possible but dont know how to get started, ( i'm verg
green with computers), i really need step by step instructions from
point a ( logging on) to point z (viewing the timer in action). if
anyone can help me, i will be delighted.....thank you


Get to the Visual Basic Editor (Alt+F11)
View the Project Explorer (Ctl+R)
(From here you can get anywhere)
Select the desired workbook
Insert a Module (will be Module1)
Paste the following code in Module1:
Sub zOnTimeSub1() '
Dim i%
i = Val(Sheets("Sheet1").Cells(1, 1))
If i = 0 Then
Sheets("Sheet1").Cells(1, 1).Interior.ColorIndex = 6
Sheets("Sheet1").Cells(1, 1).Value = 30
ElseIf i = 1 Then
Beep
Sheets("Sheet1").Cells(1, 1).Interior.ColorIndex = 3
Sheets("Sheet1").Cells(1, 1).Value = 0
Else
Sheets("Sheet1").Cells(1, 1).Value = i - 1
End If
Application.OnTime Now() + TimeValue("00:00:01"), _
"zOnTimeSub1"
End Sub

Paste the following code into Sheet1 (code):
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$A$1" And _
Target.Interior.ColorIndex = xlColorIndexNone Then
Cells(1, 1).Interior.ColorIndex = 6
Cells(1, 1).Value = 30
Application.OnTime Now() + TimeValue("00:00:01"), _
"zOnTimeSub1"
End If
End Sub

De-select A1
Select A1


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---


All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com