Urgent Help Needed

Yogi

Board Regular
Joined
Oct 21, 2002
Messages
74
I am a football coach. We have 25 seconds to call a play. I have three different formulas on the view code. The first two are working but I can't get my 25 second timer to work. No matter how arrange them only the first two work. I only have a few hours to work this bug out. Thanks in advance.Here is the formula:

Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim pausetime As Single
Dim start As Single
Dim finish As Single

Range("y3").Value = Target.Value

If Intersect(Target, Range("y9:bc58")) Is Nothing Then Range("y3").Value = ""

rw = ActiveCell.Row
If rw< 9 Then Exit Sub
If rw > 58 Then Exit Sub
If ActiveCell.Column = 26 Then Cells(rw, 56).Value = Cells(rw, 56).Value + 1
If ActiveCell.Column = 41 Then Cells(rw, 57).Value = Cells(rw, 57).Value + 1

If Target.Address = Range("BA2").MergeArea.Address Then

pausetime = 25 ' Set duration.
start = Timer ' Set start time.
Sheets(1).Range("BA2").Value = _
Format(pausetime + (start - Timer), "##")

Loop
Sheets(1).Range("BA2").Value = 25

End If

End Sub
This message was edited by Yogi on 2002-11-01 13:37
This message was edited by Yogi on 2002-11-01 13:40
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Yogi,

Try replacing your code:

pausetime = 25 ' Set duration.
start = Timer ' Set start time.
Sheets(1).Range("BA2").Value = _
Format(pausetime + (start - Timer), "##")

Loop


With the following:

Dim PauseTime As Integer
Dim TimeLeft As Integer
Dim EndTime As Single

PauseTime = 25 ' Set duration.
EndTime = Timer + PauseTime

Do
TimeLeft = EndTime - Timer
Sheets(1).Range("B1").Value = _
Format(TimeLeft, "##")
Loop Until TimeLeft <= 0
 
Upvote 0
On my previous post, the Dim of PauseTime was unnecessary since you had already done it. In addition I changed your BA2 to B1 for checkout, so of course you should set it back.
 
Upvote 0
When I ran the timer macro I couldn't run the other two macros until the timer counted all the way down. I need for all three macros to run at the same time.
 
Upvote 0
All three macros run fine seperately. The only problem I have is when I combine them. Is there any way I could rearrange the order to get them to function properly. I'm open to anything.
 
Upvote 0
Hi again Yogi,

I guess I misunderstood your original question. And I'm not sure I quite understand it yet. When you say you want all three macros to run at the same time, what do you mean? Do you want the other two macros to run each second during the countdown?

Damon
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top