خرید بک لینک

Vote count: 0

I got a simple code that do if value if lass then X wait one hour else continue the loop-basically the code need to run for a hole day.

the thing is that when the code is in the wait line i cant use the excel at all. there is a way to solve this issue ? Im adding part of the code

    For i = 1 To 3
Set OutMail = OutApp.createitem(0)
LastRefHour = Cells(2, 1).Value
HourNow = Hour(Now())
Set g = Sheets("Sheet1").Range("D2:G9").SpecialCells(xlCellTypeVisible)

If (LastRefHour < HourNow) Then

    ActiveWorkbook.Coections("Monitor-Test").Refresh
    Application.CalculateUntilAsyncQueriesDone
    If Not Application.CalculationState = xlDone Then
    DoEvents
    End If

Cells(1, 1).Copy
Cells(2, 1).PasteSpecial xlPasteValues

Else:

    Application.Wait (Now + TimeValue("00:59:00"))


End If

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 22 فروردين 1395 ساعت: 19:59

صفحه بندی