I'm running a macro in a particular workbook to display a real-time clock, and I'm trying to restrict it to this one workbook. I'm using the code With ThisWorkbook.Worksheets("") , but the Macro is still running in all other open workbooks.
Below is the macro I'm using:
Sub Recalc()
With ThisWorkbook.Worksheets("Break")
Range("A4").Value = Format(Time, "hh:mm:ss AM/PM")
Call SetTime
End With
End Sub
Sub SetTime()
With ThisWorkbook.Worksheets("Break")
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
End With
End Sub
Can someone tell me what I'm doing wrong?
Bookmarks