Rubber Beaked Woodpecker
Board Regular
- Joined
- Aug 30, 2015
- Messages
- 203
- Office Version
- 2021
Hi. The following code works very well but I would like a slight modification. When S1 = 1 I would like a 30 second delay before the code is executed. I've tried in several way using Application.Wait but cannot get this to work.
Any advice please
Thanks
RBW
Any advice please
Thanks
RBW
VBA Code:
Option Explicit
Dim currentMarket As String
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheets("Sheet1").Calculate
If Target.Columns.Count = 16 Then
Application.EnableEvents = False
Range("Q1").Value = WorksheetFunction.CountIf(Range("H5:H50"), ">0")
Range("Q2") = Range("W2")
Range("U1") = Range("U2")
Range("T1") = Range("T2")
Range("AA1") = Range("Z1")
If Range("S1") = 1 Then
'30 second delay
Call ThisSheetlogBalance
Call Completed
ElseIf Range("X2").Value = "Yes" Then
Call R1
End If
End If
Application.EnableEvents = True
End Sub