Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
I found this code online. It is a stopwatch timer. This file is stored in MS Teams/Sharepoint on a server. There are two rooms that is separated by a wall. Each room's computer has access to this file. So what I am wanting to do is if one rooms opens this file and starts the timer and the other room opens the file, both rooms need to see the exact numbers on the timer. I hope my explanation makes sense. Is this even possible? From what I have read, it is not possible to run Macros inside these apps. Is there any other way to achieve this? Thank you.
VBA Code:
Private Sub Workbook_Open()
UserForm1.Show
End Sub
VBA Code:
Private a As Boolean
Private Sub btnPause_Click()
a = False
End Sub
Private Sub btnReset_Click()
a = False
UserForm1.lblDisplay.Caption = "00:00:00"
End Sub
Private Sub btnStart_Click()
a = True
Do While a
UserForm1.lblDisplay.Caption = Format(DateAdd("s", 1, UserForm1.lblDisplay.Caption), "hh:mm:ss")
Wait = 1
Start = Timer
While Timer < Start + Wait
DoEvents
Wend
Loop
End Sub
Private Sub UserForm_Initialize()
'Maximizes to screen size
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With
End Sub