#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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 =---
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer Vijay Excel Worksheet Functions 1 April 6th 07 11:00 AM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
Timer Phil Excel Programming 4 February 6th 04 01:58 PM
API TIMER Seth Excel Programming 0 January 15th 04 01:33 PM
Timer Don Lloyd Excel Programming 2 October 17th 03 12:33 PM


All times are GMT +1. The time now is 03:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"