troubleshooting Question

Start, Stop an Restart Timer

Avatar of llawrenceg
llawrencegFlag for United States of America asked on
Windows XPMicrosoft ExcelOffice Productivity
3 Comments1 Solution494 ViewsLast Modified:
I have a call answering system that starts off  with a timer set for every 5 sec to be able  to copy and paste the caller client number fron the Windows clipboard when the phone rings to Cells B3.Then I have the current date and time put in Cell C3.
I would like to stop the timer when Cell C3  is filled and Restart when Cell H3 is filled to capture the next call.
Cells B3-H3 are filled and then copied down so that B3-H3 are blank for data from the next caller
The process repeats itsellf for each call
I start off with a workbook Open:
Private Sub Workbook_Open()
Application.OnTime TimeValue(Now + TimeValue("00:00:05")), "CheckClipboard"
End Sub

Then in a Standard Module:

Sub CheckClipboard()

Dim MyData As DataObject
Dim AllStr As String
Dim ShortStr As String

Set MyData = New DataObject
On Error Resume Next
AllStr = MyData.GetText
ShortStr = Left(AllStr, 4)

If (ShortStr = "Plan") Then
   ActiveSheet.Cells(3, 2).Value = AllStr
   MyData.SetText ""
   ActiveSheet.Cells(3, 3).Value = Now
End If

Application.OnTime TimeValue(Now + TimeValue("00:00:05")), "CheckClipboard", 
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros