Bonaocity729
New Member
- Joined
- Feb 23, 2018
- Messages
- 5
Hi everyone,
I'm new at this. I copied the below code from one of the thread. It works perfectly but I want to make it loop until I decide to cancel it. Thanks in advance.
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets("FEB-Total_pcs_per_hr")
Set sh2 = Sheets("Daily_Info")
If Sh.Name = sh1.Name Then
Application.Wait Time + TimeSerial(0, 0, 10)
sh2.Activate
End If
If Sh.Name = sh2.Name Then
Application.Wait Time + TimeSerial(0, 0, 15)
sh1.Activate
End If
End Sub
I'm new at this. I copied the below code from one of the thread. It works perfectly but I want to make it loop until I decide to cancel it. Thanks in advance.
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets("FEB-Total_pcs_per_hr")
Set sh2 = Sheets("Daily_Info")
If Sh.Name = sh1.Name Then
Application.Wait Time + TimeSerial(0, 0, 10)
sh2.Activate
End If
If Sh.Name = sh2.Name Then
Application.Wait Time + TimeSerial(0, 0, 15)
sh1.Activate
End If
End Sub